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/settings_tests/tests.py | |
| parent | df8d8d4292684d6ffa7474f1e201aed486f02b53 (diff) | |
Fixed E128 flake8 warnings in tests/.
Diffstat (limited to 'tests/settings_tests/tests.py')
| -rw-r--r-- | tests/settings_tests/tests.py | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/tests/settings_tests/tests.py b/tests/settings_tests/tests.py index 87352ba32a..8cee706d5b 100644 --- a/tests/settings_tests/tests.py +++ b/tests/settings_tests/tests.py @@ -11,7 +11,6 @@ from django.test import ( SimpleTestCase, TestCase, TransactionTestCase, modify_settings, override_settings, signals, ) -from django.utils import six @modify_settings(ITEMS={ @@ -19,8 +18,7 @@ from django.utils import six 'append': ['d'], 'remove': ['a', 'e'] }) -@override_settings(ITEMS=['a', 'c', 'e'], ITEMS_OUTER=[1, 2, 3], - TEST='override', TEST_OUTER='outer') +@override_settings(ITEMS=['a', 'c', 'e'], ITEMS_OUTER=[1, 2, 3], TEST='override', TEST_OUTER='outer') class FullyDecoratedTranTestCase(TransactionTestCase): available_apps = [] @@ -215,8 +213,7 @@ class SettingsTests(SimpleTestCase): self.assertIsInstance(decorated, type) self.assertTrue(issubclass(decorated, SimpleTestCase)) - with six.assertRaisesRegex(self, Exception, - "Only subclasses of Django SimpleTestCase*"): + with self.assertRaisesMessage(Exception, "Only subclasses of Django SimpleTestCase"): decorated = override_settings(TEST='override')(UnittestTestCaseSubclass) def test_signal_callback_context_manager(self): @@ -310,10 +307,8 @@ class TestComplexSettingOverride(SimpleTestCase): self.assertEqual(len(w), 1) # File extension may by .py, .pyc, etc. Compare only basename. - self.assertEqual(os.path.splitext(w[0].filename)[0], - os.path.splitext(__file__)[0]) - self.assertEqual(str(w[0].message), - 'Overriding setting TEST_WARN can lead to unexpected behavior.') + self.assertEqual(os.path.splitext(w[0].filename)[0], os.path.splitext(__file__)[0]) + self.assertEqual(str(w[0].message), 'Overriding setting TEST_WARN can lead to unexpected behavior.') class TrailingSlashURLTests(SimpleTestCase): @@ -351,15 +346,13 @@ class TrailingSlashURLTests(SimpleTestCase): self.assertEqual('/foo/', self.settings_module.MEDIA_URL) self.settings_module.MEDIA_URL = 'http://media.foo.com/' - self.assertEqual('http://media.foo.com/', - self.settings_module.MEDIA_URL) + self.assertEqual('http://media.foo.com/', self.settings_module.MEDIA_URL) self.settings_module.STATIC_URL = '/foo/' self.assertEqual('/foo/', self.settings_module.STATIC_URL) self.settings_module.STATIC_URL = 'http://static.foo.com/' - self.assertEqual('http://static.foo.com/', - self.settings_module.STATIC_URL) + self.assertEqual('http://static.foo.com/', self.settings_module.STATIC_URL) def test_no_end_slash(self): """ @@ -387,15 +380,13 @@ class TrailingSlashURLTests(SimpleTestCase): self.assertEqual('/wrong//', self.settings_module.MEDIA_URL) self.settings_module.MEDIA_URL = 'http://media.foo.com/wrong//' - self.assertEqual('http://media.foo.com/wrong//', - self.settings_module.MEDIA_URL) + self.assertEqual('http://media.foo.com/wrong//', self.settings_module.MEDIA_URL) self.settings_module.STATIC_URL = '/wrong//' self.assertEqual('/wrong//', self.settings_module.STATIC_URL) self.settings_module.STATIC_URL = 'http://static.foo.com/wrong//' - self.assertEqual('http://static.foo.com/wrong//', - self.settings_module.STATIC_URL) + self.assertEqual('http://static.foo.com/wrong//', self.settings_module.STATIC_URL) class SecureProxySslHeaderTest(SimpleTestCase): |
