summaryrefslogtreecommitdiff
path: root/tests/transactions
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2018-10-04 07:09:06 -0700
committerTim Graham <timograham@gmail.com>2018-10-04 10:09:06 -0400
commit5a23a285de1c36ef6e7d4ac546c12d0011fa55ec (patch)
treeed3d09f963f4c6b94b1a7635389c6ccaa435da97 /tests/transactions
parent9f6d0c11eb0c42fb9e6b311de3a5d669a7cd54e6 (diff)
downloaddjango-5a23a285de1c36ef6e7d4ac546c12d0011fa55ec.tar.gz
Used skip(If|Unless)DBFeature in transactions tests.
Diffstat (limited to 'tests/transactions')
-rw-r--r--tests/transactions/tests.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/transactions/tests.py b/tests/transactions/tests.py
index 7d4d4b777a..637a20e7e0 100644
--- a/tests/transactions/tests.py
+++ b/tests/transactions/tests.py
@@ -14,7 +14,7 @@ from django.test import (
from .models import Reporter
-@skipUnless(connection.features.uses_savepoints, "'atomic' requires transactions and savepoints.")
+@skipUnlessDBFeature('uses_savepoints')
class AtomicTests(TransactionTestCase):
"""
Tests for the atomic decorator and context manager.
@@ -228,10 +228,7 @@ class AtomicInsideTransactionTests(AtomicTests):
self.atomic.__exit__(*sys.exc_info())
-@skipIf(
- connection.features.autocommits_when_autocommit_is_off,
- "This test requires a non-autocommit mode that doesn't autocommit."
-)
+@skipIfDBFeature('autocommits_when_autocommit_is_off')
class AtomicWithoutAutocommitTests(AtomicTests):
"""All basic tests for atomic should also pass when autocommit is turned off."""
@@ -245,7 +242,7 @@ class AtomicWithoutAutocommitTests(AtomicTests):
transaction.set_autocommit(True)
-@skipUnless(connection.features.uses_savepoints, "'atomic' requires transactions and savepoints.")
+@skipUnlessDBFeature('uses_savepoints')
class AtomicMergeTests(TransactionTestCase):
"""Test merging transactions with savepoint=False."""
@@ -295,7 +292,7 @@ class AtomicMergeTests(TransactionTestCase):
self.assertQuerysetEqual(Reporter.objects.all(), ['<Reporter: Tintin>'])
-@skipUnless(connection.features.uses_savepoints, "'atomic' requires transactions and savepoints.")
+@skipUnlessDBFeature('uses_savepoints')
class AtomicErrorsTests(TransactionTestCase):
available_apps = ['transactions']
@@ -437,10 +434,7 @@ class AtomicMiscTests(TransactionTestCase):
connection.savepoint_rollback(sid)
-@skipIf(
- connection.features.autocommits_when_autocommit_is_off,
- "This test requires a non-autocommit mode that doesn't autocommit."
-)
+@skipIfDBFeature('autocommits_when_autocommit_is_off')
class NonAutocommitTests(TransactionTestCase):
available_apps = []