♻️(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:
Manuel Raynaud
2025-04-04 11:15:39 +02:00
committed by Anthony LC
parent ba136ff82f
commit 8836109945
5 changed files with 8 additions and 29 deletions

View File

@@ -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."""