diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2010-10-21 17:37:38 +0000 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2010-10-21 17:37:38 +0000 |
| commit | 0df4c1c411db33bd5785cf29486320287b206c59 (patch) | |
| tree | 9eda6bc19ccdd36beaffc682b09986f331e2a2ae | |
| parent | b855dbf676a496c2d3ac1ea6bec5ebe8e4cc5590 (diff) | |
[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
| -rw-r--r-- | tests/regressiontests/multiple_database/tests.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/regressiontests/multiple_database/tests.py b/tests/regressiontests/multiple_database/tests.py index 2547e1eae2..f27d8b5a28 100644 --- a/tests/regressiontests/multiple_database/tests.py +++ b/tests/regressiontests/multiple_database/tests.py @@ -1547,13 +1547,17 @@ class AuthTestCase(TestCase): 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): |
