]> git.jsancho.org Git - datasette-pytables.git/blob - tests/test_html.py
Post 2.0.1 release actions done
[datasette-pytables.git] / tests / test_html.py
1 from .fixtures import app_client, app_client_with_hash
2
3 def test_homepage(app_client):
4     response = app_client.get('/')
5     assert response.status == 200
6     assert 'test_tables' in response.text
7
8 def test_database_page(app_client_with_hash):
9     response = app_client_with_hash.get('/test_tables', allow_redirects=False)
10     assert response.status == 302
11     response = app_client_with_hash.get('/test_tables')
12     assert 'test_tables' in response.text
13
14 def test_table(app_client):
15     response = app_client.get('/test_tables/%group1%table1')
16     assert response.status == 200
17
18 def test_table_row(app_client):
19     response = app_client.get('/test_tables/%group1%table1/50')
20     assert response.status == 200
21
22 def test_array(app_client):
23     response = app_client.get('/test_tables/%group1%array2')
24     assert response.status == 200
25
26 def test_array_row(app_client):
27     response = app_client.get('/test_tables/%group1%array2/1050')
28     assert response.status == 200
29
30 def test_table_exact_query(app_client):
31     response = app_client.get('/test_tables/%group2%table2/?idnumber__exact=0')
32     assert response.status == 200