Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.2.X] Ensure the mutliple_database tests leave the settings in the …

…same state they found them. Backport of [14313].

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14314 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 0df4c1c411db33bd5785cf29486320287b206c59 1 parent b855dbf
@alex alex authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 tests/regressiontests/multiple_database/tests.py
View
8 tests/regressiontests/multiple_database/tests.py
@@ -1547,13 +1547,17 @@ def test_dumpdata(self):
command_output = new_io.getvalue().strip()
self.assertTrue('"email": "alice@example.com",' in command_output)
+_missing = object()
class UserProfileTestCase(TestCase):
def setUp(self):
- self.old_auth_profile_module = getattr(settings, 'AUTH_PROFILE_MODULE', None)
+ self.old_auth_profile_module = getattr(settings, 'AUTH_PROFILE_MODULE', _missing)
settings.AUTH_PROFILE_MODULE = 'multiple_database.UserProfile'
def tearDown(self):
- settings.AUTH_PROFILE_MODULE = self.old_auth_profile_module
+ if self.old_auth_profile_module is _missing:
+ del settings.AUTH_PROFILE_MODULE
+ else:
+ settings.AUTH_PROFILE_MODULE = self.old_auth_profile_module
def test_user_profiles(self):
Please sign in to comment.
Something went wrong with that request. Please try again.