diff --git a/pgcryptoauth/tests.py b/pgcryptoauth/tests.py index b9f02cf..3e37fbb 100644 --- a/pgcryptoauth/tests.py +++ b/pgcryptoauth/tests.py @@ -18,9 +18,9 @@ class PgCryptoAuthTests(TestCase): encoded = u'pgcrypto$%s' % pghash def setUp(self): - cursor = connection.cursor() - cursor.execute("CREATE EXTENSION pgcrypto") - transaction.commit_unless_managed() + with transaction.atomic(): + cursor = connection.cursor() + cursor.execute("CREATE EXTENSION pgcrypto") self.user = User.objects.create_user(username=self.username) self.user.password = self.encoded self.user.save()