diff options
| author | Tim Graham <timograham@gmail.com> | 2016-04-07 22:04:45 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-04-08 10:12:33 -0400 |
| commit | 92053acbb9160862c3e743a99ed8ccff8d4f8fd6 (patch) | |
| tree | 50e7fd28a650f0e2352cf94f92e5a66d28a81988 /tests/transactions | |
| parent | df8d8d4292684d6ffa7474f1e201aed486f02b53 (diff) | |
Fixed E128 flake8 warnings in tests/.
Diffstat (limited to 'tests/transactions')
| -rw-r--r-- | tests/transactions/tests.py | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/tests/transactions/tests.py b/tests/transactions/tests.py index b9faed1c62..5e947de65f 100644 --- a/tests/transactions/tests.py +++ b/tests/transactions/tests.py @@ -16,8 +16,7 @@ from django.test import ( from .models import Reporter -@skipUnless(connection.features.uses_savepoints, - "'atomic' requires transactions and savepoints.") +@skipUnless(connection.features.uses_savepoints, "'atomic' requires transactions and savepoints.") class AtomicTests(TransactionTestCase): """ Tests for the atomic decorator and context manager. @@ -81,8 +80,10 @@ class AtomicTests(TransactionTestCase): Reporter.objects.create(first_name="Tintin") with transaction.atomic(): Reporter.objects.create(first_name="Archibald", last_name="Haddock") - self.assertQuerysetEqual(Reporter.objects.all(), - ['<Reporter: Archibald Haddock>', '<Reporter: Tintin>']) + self.assertQuerysetEqual( + Reporter.objects.all(), + ['<Reporter: Archibald Haddock>', '<Reporter: Tintin>'] + ) def test_nested_commit_rollback(self): with transaction.atomic(): @@ -118,8 +119,10 @@ class AtomicTests(TransactionTestCase): Reporter.objects.create(first_name="Tintin") with transaction.atomic(savepoint=False): Reporter.objects.create(first_name="Archibald", last_name="Haddock") - self.assertQuerysetEqual(Reporter.objects.all(), - ['<Reporter: Archibald Haddock>', '<Reporter: Tintin>']) + self.assertQuerysetEqual( + Reporter.objects.all(), + ['<Reporter: Archibald Haddock>', '<Reporter: Tintin>'] + ) def test_merged_commit_rollback(self): with transaction.atomic(): @@ -157,8 +160,7 @@ class AtomicTests(TransactionTestCase): Reporter.objects.create(first_name="Tintin") with atomic: Reporter.objects.create(first_name="Archibald", last_name="Haddock") - self.assertQuerysetEqual(Reporter.objects.all(), - ['<Reporter: Archibald Haddock>', '<Reporter: Tintin>']) + self.assertQuerysetEqual(Reporter.objects.all(), ['<Reporter: Archibald Haddock>', '<Reporter: Tintin>']) def test_reuse_commit_rollback(self): atomic = transaction.atomic() @@ -228,8 +230,10 @@ 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.") +@skipIf( + connection.features.autocommits_when_autocommit_is_off, + "This test requires a non-autocommit mode that doesn't autocommit." +) class AtomicWithoutAutocommitTests(AtomicTests): """All basic tests for atomic should also pass when autocommit is turned off.""" @@ -243,8 +247,7 @@ class AtomicWithoutAutocommitTests(AtomicTests): transaction.set_autocommit(True) -@skipUnless(connection.features.uses_savepoints, - "'atomic' requires transactions and savepoints.") +@skipUnless(connection.features.uses_savepoints, "'atomic' requires transactions and savepoints.") class AtomicMergeTests(TransactionTestCase): """Test merging transactions with savepoint=False.""" @@ -294,8 +297,7 @@ class AtomicMergeTests(TransactionTestCase): self.assertQuerysetEqual(Reporter.objects.all(), ['<Reporter: Tintin>']) -@skipUnless(connection.features.uses_savepoints, - "'atomic' requires transactions and savepoints.") +@skipUnless(connection.features.uses_savepoints, "'atomic' requires transactions and savepoints.") class AtomicErrorsTests(TransactionTestCase): available_apps = ['transactions'] |
