diff options
| author | Carl Meyer <carl@oddbird.net> | 2011-10-26 21:07:12 +0000 |
|---|---|---|
| committer | Carl Meyer <carl@oddbird.net> | 2011-10-26 21:07:12 +0000 |
| commit | 233cdcf42426d950e4dffeca47b26e926f50811f (patch) | |
| tree | d506a00853c3ee740bc546ff2cb1d48af1531d4f /tests/regressiontests | |
| parent | 4cfb7632e0843edb19b38896a77b6e1e43711d77 (diff) | |
Fixed error message string assumptions in WSGI tests (were breaking tests on PyPy). Thanks to Alex Gaynor for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17041 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/wsgi/tests.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/tests/regressiontests/wsgi/tests.py b/tests/regressiontests/wsgi/tests.py index 6b0c433222..9da2adce54 100644 --- a/tests/regressiontests/wsgi/tests.py +++ b/tests/regressiontests/wsgi/tests.py @@ -83,20 +83,17 @@ class GetInternalWSGIApplicationTest(unittest.TestCase): @override_settings(WSGI_APPLICATION="regressiontests.wsgi.noexist.app") def test_bad_module(self): - with self.assertRaises(ImproperlyConfigured) as cm: - get_internal_wsgi_application() + with self.assertRaisesRegexp( + ImproperlyConfigured, + r"^WSGI application 'regressiontests.wsgi.noexist.app' could not be loaded; could not import module 'regressiontests.wsgi.noexist':"): - self.assertEqual( - str(cm.exception), - "WSGI application 'regressiontests.wsgi.noexist.app' could not be loaded; could not import module 'regressiontests.wsgi.noexist': No module named noexist") + get_internal_wsgi_application() @override_settings(WSGI_APPLICATION="regressiontests.wsgi.wsgi.noexist") def test_bad_name(self): - with self.assertRaises(ImproperlyConfigured) as cm: - get_internal_wsgi_application() - - self.assertEqual( - str(cm.exception), - "WSGI application 'regressiontests.wsgi.wsgi.noexist' could not be loaded; can't find 'noexist' in module 'regressiontests.wsgi.wsgi': 'module' object has no attribute 'noexist'") + with self.assertRaisesRegexp( + ImproperlyConfigured, + r"^WSGI application 'regressiontests.wsgi.wsgi.noexist' could not be loaded; can't find 'noexist' in module 'regressiontests.wsgi.wsgi':"): + get_internal_wsgi_application() |
