Author: Alex
Date: 2010-10-21 12:37:38 -0500 (Thu, 21 Oct 2010)
New Revision: 14314

Modified:
   
django/branches/releases/1.2.X/tests/regressiontests/multiple_database/tests.py
Log:
[1.2.X] Ensure the mutliple_database tests leave the settings in the same state 
they found them.  Backport of [14313].

Modified: 
django/branches/releases/1.2.X/tests/regressiontests/multiple_database/tests.py
===================================================================
--- 
django/branches/releases/1.2.X/tests/regressiontests/multiple_database/tests.py 
    2010-10-21 17:37:19 UTC (rev 14313)
+++ 
django/branches/releases/1.2.X/tests/regressiontests/multiple_database/tests.py 
    2010-10-21 17:37:38 UTC (rev 14314)
@@ -1547,13 +1547,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.

Reply via email to