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/comment_tests/tests/test_app_api.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'tests/comment_tests') diff --git a/tests/comment_tests/tests/test_app_api.py b/tests/comment_tests/tests/test_app_api.py index 7098def28a..3d88b7e896 100644 --- a/tests/comment_tests/tests/test_app_api.py +++ b/tests/comment_tests/tests/test_app_api.py @@ -1,10 +1,9 @@ -from django.apps import app_cache from django.conf import settings from django.contrib import comments from django.contrib.comments.models import Comment from django.contrib.comments.forms import CommentForm from django.core.exceptions import ImproperlyConfigured -from django.test.utils import override_settings +from django.test import modify_settings, override_settings from django.utils import six from . import CommentTestCase @@ -35,16 +34,11 @@ class CommentAppAPITests(CommentTestCase): self.assertEqual(comments.get_approve_url(c), "/approve/12345/") +@modify_settings(INSTALLED_APPS={'append': 'comment_tests.custom_comments'}) @override_settings(COMMENTS_APP='comment_tests.custom_comments') class CustomCommentTest(CommentTestCase): urls = 'comment_tests.urls' - def setUp(self): - self._with_custom_comments = app_cache._begin_with_app('comment_tests.custom_comments') - - def tearDown(self): - app_cache._end_with_app(self._with_custom_comments) - def testGetCommentApp(self): from comment_tests import custom_comments self.assertEqual(comments.get_comment_app(), custom_comments) -- cgit v1.3