Skip to content

Commit

Permalink
feat: support to provide extra cache while using real_cache in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasgomide committed Feb 28, 2024
1 parent ba64802 commit 4cb2e4e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drf_kit/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ def setUp(self):
super().setUp()
cache.clear()

def real_cache(self):
return self.settings(CACHES={"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"}})
def real_cache(self, caches: dict | None = None):
if not caches:
caches = {}
return self.settings(CACHES={"default": {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"}} | caches)

def assertNoPendingMigration(self, app_name): # pylint: disable=invalid-name
out = StringIO()
Expand Down

0 comments on commit 4cb2e4e

Please sign in to comment.