tests: do not use override_settings() at the class level

It's broken with pytest 4.2.0.
This commit is contained in:
Benjamin Dauvergne 2019-01-31 12:53:39 +01:00
parent 870bc65026
commit fa28c50edc
1 changed files with 3 additions and 1 deletions

View File

@ -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/')