diff options
Diffstat (limited to 'tests/admin_docs/tests.py')
| -rw-r--r-- | tests/admin_docs/tests.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/admin_docs/tests.py b/tests/admin_docs/tests.py index 9e004a5a07..9f5ace0360 100644 --- a/tests/admin_docs/tests.py +++ b/tests/admin_docs/tests.py @@ -1,13 +1,12 @@ import unittest -from django.apps import app_cache from django.conf import settings from django.contrib.sites.models import Site from django.contrib.admindocs import utils from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.test import TestCase -from django.test.utils import override_settings +from django.test.utils import modify_settings, override_settings class MiscTests(TestCase): @@ -17,15 +16,16 @@ class MiscTests(TestCase): User.objects.create_superuser('super', None, 'secret') self.client.login(username='super', password='secret') + @modify_settings(INSTALLED_APPS={'remove': 'django.contrib.sites'}) + @override_settings(SITE_ID=None) # will restore SITE_ID after the test def test_no_sites_framework(self): """ Without the sites framework, should not access SITE_ID or Site objects. Deleting settings is fine here as UserSettingsHolder is used. """ - with self.settings(SITE_ID=None), app_cache._without_app('django.contrib.sites'): - Site.objects.all().delete() - del settings.SITE_ID - self.client.get('/admindocs/views/') # should not raise + Site.objects.all().delete() + del settings.SITE_ID + self.client.get('/admindocs/views/') # should not raise @override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) |
