Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed error message string assumptions in WSGI tests (were breaking t…

…ests 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
  • Loading branch information...
commit 233cdcf42426d950e4dffeca47b26e926f50811f 1 parent 4cfb763
@carljm carljm authored
Showing with 8 additions and 11 deletions.
  1. +8 −11 tests/regressiontests/wsgi/tests.py
View
19 tests/regressiontests/wsgi/tests.py
@@ -83,20 +83,17 @@ def mock_get_wsgi_app():
@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()

0 comments on commit 233cdcf

Please sign in to comment.
Something went wrong with that request. Please try again.