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/wsgi/tests.py | |
| parent | df8d8d4292684d6ffa7474f1e201aed486f02b53 (diff) | |
Fixed E128 flake8 warnings in tests/.
Diffstat (limited to 'tests/wsgi/tests.py')
| -rw-r--r-- | tests/wsgi/tests.py | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/tests/wsgi/tests.py b/tests/wsgi/tests.py index 4056ffda84..f472d4fab9 100644 --- a/tests/wsgi/tests.py +++ b/tests/wsgi/tests.py @@ -1,19 +1,16 @@ from __future__ import unicode_literals -import unittest - from django.core.exceptions import ImproperlyConfigured from django.core.servers.basehttp import get_internal_wsgi_application from django.core.signals import request_started from django.core.wsgi import get_wsgi_application from django.db import close_old_connections -from django.test import TestCase, override_settings +from django.test import SimpleTestCase, override_settings from django.test.client import RequestFactory -from django.utils import six @override_settings(ROOT_URLCONF='wsgi.urls') -class WSGITest(TestCase): +class WSGITest(SimpleTestCase): def setUp(self): request_started.disconnect(close_old_connections) @@ -73,7 +70,7 @@ class WSGITest(TestCase): self.assertIsInstance(response, FileWrapper) -class GetInternalWSGIApplicationTest(unittest.TestCase): +class GetInternalWSGIApplicationTest(SimpleTestCase): @override_settings(WSGI_APPLICATION="wsgi.wsgi.application") def test_success(self): """ @@ -110,16 +107,12 @@ class GetInternalWSGIApplicationTest(unittest.TestCase): @override_settings(WSGI_APPLICATION="wsgi.noexist.app") def test_bad_module(self): - with six.assertRaisesRegex(self, - ImproperlyConfigured, - r"^WSGI application 'wsgi.noexist.app' could not be loaded; Error importing.*"): - + msg = "WSGI application 'wsgi.noexist.app' could not be loaded; Error importing" + with self.assertRaisesMessage(ImproperlyConfigured, msg): get_internal_wsgi_application() @override_settings(WSGI_APPLICATION="wsgi.wsgi.noexist") def test_bad_name(self): - with six.assertRaisesRegex(self, - ImproperlyConfigured, - r"^WSGI application 'wsgi.wsgi.noexist' could not be loaded; Error importing.*"): - + msg = "WSGI application 'wsgi.wsgi.noexist' could not be loaded; Error importing" + with self.assertRaisesMessage(ImproperlyConfigured, msg): get_internal_wsgi_application() |
