From 1e8123b5b82f2895cff1607620c214049a660f98 Mon Sep 17 00:00:00 2001 From: jordi Date: Wed, 21 Mar 2018 12:37:26 +0100 Subject: [PATCH] Add encode in keys command to fix the support with django-redis-4.9.0 --- mockredis/client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mockredis/client.py b/mockredis/client.py index 926e048..aecd4a9 100644 --- a/mockredis/client.py +++ b/mockredis/client.py @@ -155,6 +155,7 @@ def keys(self, pattern='*'): """Emulate keys.""" # making sure the pattern is unicode/str. try: + pattern = self._encode(pattern) pattern = pattern.decode('utf-8') # This throws an AttributeError in python 3, or an # UnicodeEncodeError in python 2