From 016c49d7a9b149720c75501525f79f19a73ff3b3 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 19 Apr 2017 10:21:37 +0200 Subject: Django 1.8: remove transaction.commit_unless_managed --- ishtar_common/tests.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'ishtar_common/tests.py') diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 49db86b64..01ff26c5e 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -91,10 +91,9 @@ class TestCase(BaseTestCase): super(TestCase, self)._pre_setup() if settings.USE_SPATIALITE_FOR_TESTS: return - c = connection.cursor() - for view in [CRBulkView, FirstBaseFindView, BFBulkView, FBulkView]: - c.execute(view.CREATE_SQL) - transaction.commit_unless_managed() + with connection.cursor() as c: + for view in [CRBulkView, FirstBaseFindView, BFBulkView, FBulkView]: + c.execute(view.CREATE_SQL) class CommandsTestCase(TestCase): -- cgit v1.2.3