Django 1.9 cache.get_or_set works incorrectly with DummyCache backend

89 views
Skip to first unread message

Oleksiy Ivanenko

unread,
Dec 1, 2015, 7:09:04 AM12/1/15
to Django developers (Contributions to Django itself)
Hi,

I'm trying to use Django 1.9rc2
There is some issue when you use django.core.cache.cache.get_or_set with DummyCache backend.

from django.core.cache import cache

cache
.get_or_set('some_key', 'my_val')  # Always returns None. Not a default value
This thing brakes all my tests, when I use DummyCache.

Is this behaviour expected?
Or we need to figure out how to handle it?


---
Regards,
Oleksiy Ivanenko


Tim Graham

unread,
Dec 1, 2015, 8:31:00 AM12/1/15
to Django developers (Contributions to Django itself)
It seems to be an omission in the implementation. Feel free to create a Trac ticket and offer a patch if you can.

For future reference, please don't cross post between django-users (appropriate place for "is it a bug?" questions) and django-developers. Thanks!

Oleksiy Ivanenko

unread,
Dec 1, 2015, 11:19:35 AM12/1/15
to Django developers (Contributions to Django itself)
Ticket in Trac https://code.djangoproject.com/ticket/25840

PS. Sorry for cross post. It was my first try to post in groups.
Reply all
Reply to author
Forward
0 new messages