Skip to content

Commit

Permalink
fix: patch all caches
Browse files Browse the repository at this point in the history
  • Loading branch information
joaodaher committed Aug 19, 2024
1 parent 034f847 commit ee3f533
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion drf_kit/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from unittest.mock import ANY, patch

import rest_framework
from django.conf import settings
from django.core.cache import cache
from django.core.management import call_command
from django.db.models import Model
Expand All @@ -30,7 +31,9 @@ def setUp(self):
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)
for cache_name in getattr(settings, "CACHES", {}):
caches[cache_name] = {"BACKEND": "django.core.cache.backends.locmem.LocMemCache"}
return self.settings(CACHES=caches)

def assertNoPendingMigration(self, app_name):
out = StringIO()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "drf-kit"
version = "1.42.4"
version = "1.42.5"
description = "DRF Toolkit"
authors = ["Nilo Saude <[email protected]>"]
packages = [
Expand Down

0 comments on commit ee3f533

Please sign in to comment.