We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce17fb3 commit 8f8ee48Copy full SHA for 8f8ee48
1 file changed
app/conftest.py
@@ -1,8 +1,17 @@
1
from core.util.thread_local import thread_local
2
+from django.core.cache import cache
3
from django.test import override_settings
4
from pytest import fixture
5
6
7
+@fixture(autouse=True)
8
+def _clear_cache():
9
+ # /api/schema 는 cache_page 로 LocMemCache 에 캐시되는데, 캐시는 DB 와 달리 테스트 간 롤백되지 않는다.
10
+ # 먼저 실행된 테스트가 만든 스키마(예: SocialApp 없는 상태로 생성된 provider enum 누락분)가 누출되므로 매 테스트 격리.
11
+ cache.clear()
12
+ yield
13
+
14
15
@fixture(autouse=True)
16
def _celery_eager():
17
with override_settings(CELERY_TASK_ALWAYS_EAGER=True, CELERY_TASK_EAGER_PROPAGATES=False):
0 commit comments