mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Sometimes sort tables by number of relationships, closes #460
This commit is contained in:
parent
689cf9c139
commit
faf33515b2
4 changed files with 36 additions and 4 deletions
|
|
@ -34,6 +34,21 @@ def test_homepage(app_client):
|
|||
assert d["views_count"] == 4
|
||||
|
||||
|
||||
def test_homepage_sort_by_relationships(app_client):
|
||||
response = app_client.get("/.json?_sort=relationships")
|
||||
assert response.status == 200
|
||||
tables = [
|
||||
t["name"] for t in response.json["fixtures"]["tables_and_views_truncated"]
|
||||
]
|
||||
assert [
|
||||
"simple_primary_key",
|
||||
"complex_foreign_keys",
|
||||
"searchable_tags",
|
||||
"foreign_key_references",
|
||||
"facetable",
|
||||
] == tables
|
||||
|
||||
|
||||
def test_database_page(app_client):
|
||||
response = app_client.get("/fixtures.json")
|
||||
data = response.json
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue