X-Git-Url: https://git.jsancho.org/?p=datasette-pytables.git;a=blobdiff_plain;f=tests%2Ftest_html.py;h=a545fe5ebe98db6d993859d7cb3d4cc58a90cf21;hp=bbeb3a7fb46c0928f10893a4faaae7e89f3e8a02;hb=HEAD;hpb=6e41ba82816a32b30e077b49cae55a01a1da9dc5 diff --git a/tests/test_html.py b/tests/test_html.py index bbeb3a7..a545fe5 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -1,28 +1,32 @@ -from .fixtures import app_client +from .fixtures import app_client, app_client_with_hash def test_homepage(app_client): - response = app_client.get('/', gather_request=False) + response = app_client.get('/') assert response.status == 200 assert 'test_tables' in response.text -def test_database_page(app_client): - response = app_client.get('/test_tables', allow_redirects=False, gather_request=False) +def test_database_page(app_client_with_hash): + response = app_client_with_hash.get('/test_tables', allow_redirects=False) assert response.status == 302 - response = app_client.get('/test_tables', gather_request=False) + response = app_client_with_hash.get('/test_tables') assert 'test_tables' in response.text def test_table(app_client): - response = app_client.get('/test_tables/%2Fgroup1%2Ftable1', gather_request=False) + response = app_client.get('/test_tables/%group1%table1') assert response.status == 200 def test_table_row(app_client): - response = app_client.get('/test_tables/%2Fgroup1%2Ftable1/50', gather_request=False) + response = app_client.get('/test_tables/%group1%table1/50') assert response.status == 200 def test_array(app_client): - response = app_client.get('/test_tables/%2Fgroup1%2Farray2', gather_request=False) + response = app_client.get('/test_tables/%group1%array2') assert response.status == 200 def test_array_row(app_client): - response = app_client.get('/test_tables/%2Fgroup1%2Farray2/1050', gather_request=False) + response = app_client.get('/test_tables/%group1%array2/1050') + assert response.status == 200 + +def test_table_exact_query(app_client): + response = app_client.get('/test_tables/%group2%table2/?idnumber__exact=0') assert response.status == 200