From fa28c50edc59b9ed84d5a67161e4cdf1fa272175 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 31 Jan 2019 12:53:39 +0100 Subject: [PATCH] tests: do not use override_settings() at the class level It's broken with pytest 4.2.0. --- tests/test_all.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_all.py b/tests/test_all.py index 98a5a9826..98ad6d16e 100644 --- a/tests/test_all.py +++ b/tests/test_all.py @@ -288,13 +288,13 @@ class UserProfileTests(TestCase): self.assertEqual(set(form.fields), set(['next_url'])) -@override_settings(ROOT_URLCONF='cache_urls') class CacheTests(TestCase): @pytest.fixture(autouse=True) def cache_settings(self, settings): settings.A2_CACHE_ENABLED = True + @override_settings(ROOT_URLCONF='cache_urls') def test_cache_decorator_base(self): import random from authentic2.decorators import CacheDecoratorBase @@ -344,6 +344,7 @@ class CacheTests(TestCase): for a in range(2, 10): self.assertEquals(i(a, a), a) + @override_settings(ROOT_URLCONF='cache_urls') def test_django_cache(self): response1 = self.client.get('/django_cache/', HTTP_HOST='cache1.example.com') @@ -354,6 +355,7 @@ class CacheTests(TestCase): self.assertNotEqual(response1.content, response2.content) self.assertEqual(response1.content, response3.content) + @override_settings(ROOT_URLCONF='cache_urls') def test_session_cache(self): client = Client() response1 = client.get('/session_cache/')