mirror of
https://github.com/django/django.git
synced 2025-12-04 00:55:36 +00:00
Added a return value to the add() method for caches. It's now possible to tell
if a call to add() ended up storing something in the cache. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8278 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
38dc472796
commit
f6670e1341
8 changed files with 20 additions and 9 deletions
3
tests/regressiontests/cache/tests.py
vendored
3
tests/regressiontests/cache/tests.py
vendored
|
|
@ -31,7 +31,8 @@ class Cache(unittest.TestCase):
|
|||
def test_add(self):
|
||||
# test add (only add if key isn't already in cache)
|
||||
cache.add("addkey1", "value")
|
||||
cache.add("addkey1", "newvalue")
|
||||
result = cache.add("addkey1", "newvalue")
|
||||
self.assertEqual(result, False)
|
||||
self.assertEqual(cache.get("addkey1"), "value")
|
||||
|
||||
def test_non_existent(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue