db.view_exists() method, needed by #1896

This commit is contained in:
Simon Willison 2022-11-18 14:16:38 -08:00
commit c588a89f26
3 changed files with 22 additions and 0 deletions

View file

@ -78,6 +78,19 @@ async def test_table_exists(db, tables, exists):
assert exists == actual
@pytest.mark.parametrize(
"view,expected",
(
("not_a_view", False),
("paginated_view", True),
),
)
@pytest.mark.asyncio
async def test_view_exists(db, view, expected):
actual = await db.view_exists(view)
assert actual == expected
@pytest.mark.parametrize(
"table,expected",
(