Permalink
Browse files

Revert "clean up patch for ticket #14315"

This reverts commit 2a3202d.
  • Loading branch information...
1 parent 2a3202d commit 09cf6818819945246ab7bddb44c5fbd8d692ffe6 @tobiasmcnulty tobiasmcnulty committed Nov 13, 2011
Showing with 0 additions and 8 deletions.
  1. +0 −6 django/core/cache/backends/memcached.py
  2. +0 −2 tests/regressiontests/cache/tests.py
@@ -83,9 +83,6 @@ def close(self, **kwargs):
def incr(self, key, delta=1, version=None):
key = self.make_key(key, version=version)
- # memcached doesn't support a negative delta
- if delta < 0:
- return self._cache.decr(key, -delta)
try:
val = self._cache.incr(key, delta)
@@ -101,9 +98,6 @@ def incr(self, key, delta=1, version=None):
def decr(self, key, delta=1, version=None):
key = self.make_key(key, version=version)
- # memcached doesn't support a negative delta
- if delta < 0:
- return self._cache.incr(key, -delta)
try:
val = self._cache.decr(key, delta)
@@ -243,7 +243,6 @@ def test_incr(self):
self.assertEqual(self.cache.incr('answer', 10), 52)
self.assertEqual(self.cache.get('answer'), 52)
self.assertRaises(ValueError, self.cache.incr, 'does_not_exist')
- self.assertEqual(self.cache.incr('answer', -10), 42)
def test_decr(self):
# Cache values can be decremented
@@ -253,7 +252,6 @@ def test_decr(self):
self.assertEqual(self.cache.decr('answer', 10), 32)
self.assertEqual(self.cache.get('answer'), 32)
self.assertRaises(ValueError, self.cache.decr, 'does_not_exist')
- self.assertEqual(self.cache.decr('answer', -10), 42)
def test_data_types(self):
# Many different data types can be cached

0 comments on commit 09cf681

Please sign in to comment.