Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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 Gaynor authored October 21, 2010
8  tests/regressiontests/multiple_database/tests.py
@@ -1547,13 +1547,17 @@ def test_dumpdata(self):
1547 1547
         command_output = new_io.getvalue().strip()
1548 1548
         self.assertTrue('"email": "alice@example.com",' in command_output)
1549 1549
 
  1550
+_missing = object()
1550 1551
 class UserProfileTestCase(TestCase):
1551 1552
     def setUp(self):
1552  
-        self.old_auth_profile_module = getattr(settings, 'AUTH_PROFILE_MODULE', None)
  1553
+        self.old_auth_profile_module = getattr(settings, 'AUTH_PROFILE_MODULE', _missing)
1553 1554
         settings.AUTH_PROFILE_MODULE = 'multiple_database.UserProfile'
1554 1555
 
1555 1556
     def tearDown(self):
1556  
-        settings.AUTH_PROFILE_MODULE = self.old_auth_profile_module
  1557
+        if self.old_auth_profile_module is _missing:
  1558
+            del settings.AUTH_PROFILE_MODULE
  1559
+        else:
  1560
+            settings.AUTH_PROFILE_MODULE = self.old_auth_profile_module
1557 1561
 
1558 1562
     def test_user_profiles(self):
1559 1563
 

0 notes on commit 0df4c1c

Please sign in to comment.
Something went wrong with that request. Please try again.