summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-09-27 09:51:49 -0400
committerTim Graham <timograham@gmail.com>2017-09-27 09:51:49 -0400
commitc7e9e226953bec08969c5f5c734f50c0835bb9b2 (patch)
tree8cfc1b8e29a420ee6ee4a5e578abfc5ae0d8b6d1
parente8c45963296eb8bf3938bf9ece30b585a8cbb097 (diff)
Added cleanup for an introspection test.
-rw-r--r--tests/introspection/tests.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/introspection/tests.py b/tests/introspection/tests.py
index 2e68e52542..63817a5e3d 100644
--- a/tests/introspection/tests.py
+++ b/tests/introspection/tests.py
@@ -44,9 +44,12 @@ class IntrospectionTests(TransactionTestCase):
self.fail("The test user has no CREATE VIEW privileges")
else:
raise
-
- self.assertIn('introspection_article_view', connection.introspection.table_names(include_views=True))
- self.assertNotIn('introspection_article_view', connection.introspection.table_names())
+ try:
+ self.assertIn('introspection_article_view', connection.introspection.table_names(include_views=True))
+ self.assertNotIn('introspection_article_view', connection.introspection.table_names())
+ finally:
+ with connection.cursor() as cursor:
+ cursor.execute('DROP VIEW introspection_article_view')
def test_unmanaged_through_model(self):
tables = connection.introspection.django_table_names()