From 21259cc60fbf327e9eaaf24942745c91329e3ccc Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Tue, 2 Jul 2019 12:00:52 +0200 Subject: [PATCH] Fixed flaky tests because of license cache --- api/tests/conftest.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/tests/conftest.py b/api/tests/conftest.py index d5b87e724..ec432a76b 100644 --- a/api/tests/conftest.py +++ b/api/tests/conftest.py @@ -29,6 +29,7 @@ from rest_framework.test import APIClient, APIRequestFactory from funkwhale_api.activity import record from funkwhale_api.federation import actors +from funkwhale_api.music import licenses from funkwhale_api.moderation import mrf @@ -437,3 +438,10 @@ def mrf_outbox_registry(mocker): registry = mrf.Registry() mocker.patch("funkwhale_api.moderation.mrf.outbox", registry) return registry + + +@pytest.fixture(autouse=True) +def clear_license_cache(db): + licenses._cache = None + yield + licenses._cache = None