Author: Alex
Date: 2010-10-21 12:37:19 -0500 (Thu, 21 Oct 2010)
New Revision: 14313
Modified:
django/trunk/tests/regressiontests/multiple_database/tests.py
Log:
Ensure the mutliple_database tests leave the settings in the same state they
found them.
Modified: django/trunk/tests/regressiontests/multiple_database/tests.py
===================================================================
--- django/trunk/tests/regressiontests/multiple_database/tests.py
2010-10-21 17:36:38 UTC (rev 14312)
+++ django/trunk/tests/regressiontests/multiple_database/tests.py
2010-10-21 17:37:19 UTC (rev 14313)
@@ -1548,13 +1548,17 @@
command_output = new_io.getvalue().strip()
self.assertTrue('"email": "[email protected]",' 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):
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.