mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +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:
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):
|
||||
|
||||
Reference in New Issue
Block a user