mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 18:07:36 -02:30
Clear cache between tests to prevent cached settings sticking around.
This commit is contained in:
@@ -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():
|
||||||
'''
|
'''
|
||||||
|
|||||||
Reference in New Issue
Block a user