From f45e39ba8e19ade6b05be71b4e1ac09ea80c0af5 Mon Sep 17 00:00:00 2001 From: Brian Rosner Date: Mon, 12 Apr 2010 14:55:45 +0000 Subject: Fixed #11957 -- exceptions in admin.py are no longer hidden after second request Before you had to restart runserver for the correct exception message to show up again. Reverts fix in r9680 which has this side-affect. Thanks to jarrow, carljm and ramiro for their work on the patch and tickets. Backport of r12956 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12957 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/bug8245/tests.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/regressiontests/bug8245/tests.py b/tests/regressiontests/bug8245/tests.py index c1cc3b595c..b7c7bcdf7c 100644 --- a/tests/regressiontests/bug8245/tests.py +++ b/tests/regressiontests/bug8245/tests.py @@ -18,6 +18,13 @@ class Bug8245Test(TestCase): else: self.fail( 'autodiscover should have raised a "Bad admin module" error.') - # Calling autodiscover again should bail out early and not raise an - # AlreadyRegistered error. - admin.autodiscover() + + # Calling autodiscover again should raise the very same error it did + # the first time, not an AlreadyRegistered error. + try: + admin.autodiscover() + except Exception, e: + self.failUnlessEqual(str(e), "Bad admin module") + else: + self.fail( + 'autodiscover should have raised a "Bad admin module" error.') -- cgit v1.3