Skip to content
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

AttributeError: 'FakeStrictRedis' object has no attribute 'eval' #176

Closed
Panter7777 opened this issue Feb 2, 2018 · 4 comments
Closed

Comments

@Panter7777
Copy link

Panter7777 commented Feb 2, 2018

fakeredis==0.9.0
Django==1.11.5
redis==2.10.6
django-redis==4.8.0

use cache from django from django.core.cache import cache

# settings.py
CACHES = {
    'default': {
        'BACKEND': 'django_redis.cache.RedisCache',
        'LOCATION': REDIS_URL,
        'OPTIONS': {
            'CLIENT_CLASS': 'django_redis.client.DefaultClient',
            'SERIALIZER': 'django_redis.serializers.json.JSONSerializer',
        },
        'KEY_PREFIX': 'backend',
    }
}
# Settings for tests
if 'test' in sys.argv[1:]:
    import fakeredis
    CACHES['default']['OPTIONS']['REDIS_CLIENT_CLASS'] = "fakeredis.FakeStrictRedis"
File ".../customer/views.py", line 111, in login
    cache.incr(key)
  File ".../lib/python3.5/site-packages/django_redis/cache.py", line 33, in _decorator
    return method(self, *args, **kwargs)
  File ".../lib/python3.5/site-packages/django_redis/cache.py", line 117, in incr
    return self.client.incr(*args, **kwargs)
  File ".../lib/python3.5/site-packages/django_redis/client/default.py", line 427, in incr
    return self._incr(key=key, delta=delta, version=version, client=client)
  File ".../lib/python3.5/site-packages/django_redis/client/default.py", line 398, in _incr
    value = client.eval(lua, 1, key, delta)
AttributeError: 'FakeStrictRedis' object has no attribute 'eval'
@Panter7777
Copy link
Author

When you going to create new release with this fix?

@bmerry
Copy link
Collaborator

bmerry commented Feb 15, 2018

Probably next week, although if I get more PRs to improve the scripting support further then I'll try to get those in first.

@Panter7777
Copy link
Author

Hello. 25 days passed, what about fixes? When you going to create new release?

@bmerry
Copy link
Collaborator

bmerry commented Mar 12, 2018

It's in the fakenewsredis 0.10.0 release. At some point in the future I want to merge the fakenewsredis fork back into fakeredis (I've recently been given the access to do so, but won't have time this month), so in the meantime I suggest using fakenewsredis (and filing any issues with it there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants