Skip to content

Commit d95a681

Browse files
committed
introspection test edits
1 parent 1af65cc commit d95a681

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

tests/introspection/tests.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,14 @@ def test_table_names(self):
3434
)
3535

3636
def test_django_table_names(self):
37-
with connection.cursor() as cursor:
38-
cursor.execute("CREATE TABLE django_ixn_test_table (id INTEGER);")
39-
tl = connection.introspection.django_table_names()
40-
cursor.execute("DROP TABLE django_ixn_test_table;")
41-
self.assertNotIn(
42-
"django_ixn_test_table",
43-
tl,
44-
"django_table_names() returned a non-Django table",
45-
)
37+
connection.database.create_collection("django_ixn_test_table")
38+
tl = connection.introspection.django_table_names()
39+
connection.database["django_ixn_test_table"].drop()
40+
self.assertNotIn(
41+
"django_ixn_test_table",
42+
tl,
43+
"django_table_names() returned a non-Django table",
44+
)
4645

4746
def test_django_table_names_retval_type(self):
4847
# Table name is a list #15216

0 commit comments

Comments
 (0)