1
0
mirror of https://github.com/django/django.git synced 2025-10-29 16:46:11 +00:00

Convert much of the regression tests to use absolute imports. There's still work to be done though.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16976 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor
2011-10-13 18:51:33 +00:00
parent d5a45d79fe
commit d362c1546f
104 changed files with 396 additions and 220 deletions

View File

@@ -1,3 +1,5 @@
from __future__ import with_statement
from django.contrib import admin
from django.utils.unittest import TestCase
@@ -9,20 +11,12 @@ class Bug8245Test(TestCase):
"""
def test_bug_8245(self):
# The first time autodiscover is called, we should get our real error.
try:
with self.assertRaises(Exception) as cm:
admin.autodiscover()
except Exception, e:
self.assertEqual(str(e), "Bad admin module")
else:
self.fail(
'autodiscover should have raised a "Bad admin module" error.')
self.assertEqual(str(cm.exception), "Bad admin module")
# Calling autodiscover again should raise the very same error it did
# the first time, not an AlreadyRegistered error.
try:
with self.assertRaises(Exception) as cm:
admin.autodiscover()
except Exception, e:
self.assertEqual(str(e), "Bad admin module")
else:
self.fail(
'autodiscover should have raised a "Bad admin module" error.')
self.assertEqual(str(cm.exception), "Bad admin module")