Fixed display of database color

Closes #2139, closes #2119
This commit is contained in:
Simon Willison 2023-08-10 22:16:19 -07:00
commit 4535568f2c
11 changed files with 39 additions and 18 deletions

View file

@ -1103,3 +1103,23 @@ async def test_breadcrumbs_respect_permissions(
assert actual == expected_links
finally:
ds_client.ds._metadata_local = orig
@pytest.mark.asyncio
async def test_database_color(ds_client):
expected_color = ds_client.ds.get_database("fixtures").color
# Should be something like #9403e5
expected_fragments = (
"10px solid #{}".format(expected_color),
"border-color: #{}".format(expected_color),
)
assert len(expected_color) == 6
for path in (
"/",
"/fixtures",
"/fixtures/facetable",
"/fixtures/paginated_view",
"/fixtures/pragma_cache_size",
):
response = await ds_client.get(path)
assert any(fragment in response.text for fragment in expected_fragments)