♻️(back) reset cache after every test
We move the cache reset in the global conf test to not have to think about reseting the cache when we implement test.
This commit is contained in:
committed by
Anthony LC
parent
ba136ff82f
commit
8836109945
@@ -2,6 +2,8 @@
|
||||
|
||||
from unittest import mock
|
||||
|
||||
from django.core.cache import cache
|
||||
|
||||
import pytest
|
||||
|
||||
USER = "user"
|
||||
@@ -9,6 +11,12 @@ TEAM = "team"
|
||||
VIA = [USER, TEAM]
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def clear_cache():
|
||||
"""Fixture to clear the cache before each test."""
|
||||
cache.clear()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_user_teams():
|
||||
"""Mock for the "teams" property on the User model."""
|
||||
|
||||
Reference in New Issue
Block a user