summaryrefslogtreecommitdiff
path: root/tests/admin_docs
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-23 10:37:34 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-23 21:37:56 +0100
commitda16bb30ff238aa4d59b4186d92ef5429d8d0045 (patch)
treedfda0b750aa0d3a71c4751edcb7b86f3517e2b3f /tests/admin_docs
parent5241763c81b6afe1c0327ff7eb0d75c643f24ce0 (diff)
Dropped AppCache._empty, _with_app and _without_app.
It's now easier to achieve the same effect with modify_settings or override_settings.
Diffstat (limited to 'tests/admin_docs')
-rw-r--r--tests/admin_docs/tests.py12
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',))