From da16bb30ff238aa4d59b4186d92ef5429d8d0045 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Mon, 23 Dec 2013 10:37:34 +0100 Subject: Dropped AppCache._empty, _with_app and _without_app. It's now easier to achieve the same effect with modify_settings or override_settings. --- tests/admin_docs/tests.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/admin_docs') 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',)) -- cgit v1.3