1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Refs #33288 -- Made SQLite introspection raise DatabaseError on nonexistent tables.

All the other backends behave this way and we had to make adjustments
to our test suite to account for this discrepancy.

This also allows SQLite's get_relations() not to raise on a nonexistent
table while making sure the InspectDBTestCase.test_introspection_errors
test which ensures an error during introspection is surfaced in
generated models files still passes.
This commit is contained in:
Simon Charette
2021-11-13 19:22:36 -05:00
committed by Mariusz Felisiak
parent 8d9827c06c
commit 30ec7fe89a
2 changed files with 3 additions and 3 deletions

View File

@@ -119,9 +119,6 @@ class SchemaTests(TransactionTestCase):
for name, (type, desc) in columns.items():
if isinstance(type, tuple):
columns[name] = (type[0], desc)
# SQLite also doesn't error properly
if not columns:
raise DatabaseError("Table does not exist (empty pragma)")
return columns
def get_primary_key(self, table):