Skip to content

Remove unused _get_prefix() method from RedisCache class. #552

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/flask_caching/backends/rediscache.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ def factory(cls, app, config, args, kwargs):

return new_class

def _get_prefix(self):
return (
self.key_prefix if isinstance(self.key_prefix, str) else self.key_prefix()
)

def dump_object(self, value):
"""Dumps an object into a string for redis. By default it serializes
integers as regular string and pickle dumps everything else.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_backend_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ def make_cache(self, request):
c.clear()

def test_compat(self, c):
assert c._write_client.set(c._get_prefix() + "foo", "Awesome")
assert c._write_client.set(c.key_prefix + "foo", "Awesome")
assert c.get("foo") == b"Awesome"
assert c._write_client.set(c._get_prefix() + "foo", "42")
assert c._write_client.set(c.key_prefix + "foo", "42")
assert c.get("foo") == 42

def test_empty_host(self):
Expand Down