Commit 085e4c91 authored by Alex Gaynor's avatar Alex Gaynor
Browse files

Ensure the mutliple_database tests leave the settings in the same state they found them.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14313 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent 9d5d757b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1548,12 +1548,16 @@ 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):
        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):