Clear cache between tests to prevent cached settings sticking around.

This commit is contained in:
Chris Church
2016-11-29 11:50:14 -05:00
parent 6de0057c03
commit 9c2ae43ac6

View File

@@ -9,6 +9,7 @@ from datetime import timedelta
# Django # Django
from django.core.urlresolvers import resolve from django.core.urlresolvers import resolve
from django.core.cache import cache
from django.utils.six.moves.urllib.parse import urlparse from django.utils.six.moves.urllib.parse import urlparse
from django.utils import timezone from django.utils import timezone
from django.contrib.auth.models import User from django.contrib.auth.models import User
@@ -47,6 +48,14 @@ from awx.main.models.notifications import (
) )
@pytest.fixture(autouse=True)
def clear_cache():
'''
Clear cache (local memory) for each test to prevent using cached settings.
'''
cache.clear()
@pytest.fixture(scope="session", autouse=False) @pytest.fixture(scope="session", autouse=False)
def disable_signals(): def disable_signals():
''' '''