Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Carl Meyer authored October 26, 2011

Showing 1 changed file with 8 additions and 11 deletions. Show diff stats Hide diff stats

  1. 19  tests/regressiontests/wsgi/tests.py
19  tests/regressiontests/wsgi/tests.py
@@ -83,20 +83,17 @@ def mock_get_wsgi_app():
83 83
 
84 84
     @override_settings(WSGI_APPLICATION="regressiontests.wsgi.noexist.app")
85 85
     def test_bad_module(self):
86  
-        with self.assertRaises(ImproperlyConfigured) as cm:
87  
-            get_internal_wsgi_application()
  86
+        with self.assertRaisesRegexp(
  87
+            ImproperlyConfigured,
  88
+            r"^WSGI application 'regressiontests.wsgi.noexist.app' could not be loaded; could not import module 'regressiontests.wsgi.noexist':"):
88 89
 
89  
-        self.assertEqual(
90  
-            str(cm.exception),
91  
-            "WSGI application 'regressiontests.wsgi.noexist.app' could not be loaded; could not import module 'regressiontests.wsgi.noexist': No module named noexist")
  90
+            get_internal_wsgi_application()
92 91
 
93 92
 
94 93
     @override_settings(WSGI_APPLICATION="regressiontests.wsgi.wsgi.noexist")
95 94
     def test_bad_name(self):
96  
-        with self.assertRaises(ImproperlyConfigured) as cm:
97  
-            get_internal_wsgi_application()
98  
-
99  
-        self.assertEqual(
100  
-            str(cm.exception),
101  
-            "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'")
  95
+        with self.assertRaisesRegexp(
  96
+            ImproperlyConfigured,
  97
+            r"^WSGI application 'regressiontests.wsgi.wsgi.noexist' could not be loaded; can't find 'noexist' in module 'regressiontests.wsgi.wsgi':"):
102 98
 
  99
+            get_internal_wsgi_application()

0 notes on commit 233cdcf

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