1
0
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:
Malcolm Tredinnick
2008-08-10 03:52:21 +00:00
parent 38dc472796
commit f6670e1341
8 changed files with 20 additions and 9 deletions

View File

@@ -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):