Fix #866: does not follow
This commit is contained in:
parent
0205d827f1
commit
5c3d91e65e
@ -5,6 +5,7 @@ Changelog
|
||||
|
||||
Changes in 0.9.X - DEV
|
||||
======================
|
||||
- `BaseDict` does not follow `setdefault` #866
|
||||
- Add support for $type operator # 766
|
||||
- Fix tests for pymongo 2.8+ #877
|
||||
- No module named 'django.utils.importlib' (Django dev) #872
|
||||
|
@ -75,6 +75,10 @@ class BaseDict(dict):
|
||||
self._mark_as_changed()
|
||||
return super(BaseDict, self).popitem(*args, **kwargs)
|
||||
|
||||
def setdefault(self, *args, **kwargs):
|
||||
self._mark_as_changed()
|
||||
return super(BaseDict, self).setdefault(*args, **kwargs)
|
||||
|
||||
def update(self, *args, **kwargs):
|
||||
self._mark_as_changed()
|
||||
return super(BaseDict, self).update(*args, **kwargs)
|
||||
|
@ -1176,6 +1176,11 @@ class FieldTest(unittest.TestCase):
|
||||
post.reload()
|
||||
self.assertEqual('updated', post.info['title'])
|
||||
|
||||
post.info.setdefault('authors', [])
|
||||
post.save()
|
||||
post.reload()
|
||||
self.assertEqual([], post.info['authors'])
|
||||
|
||||
BlogPost.drop_collection()
|
||||
|
||||
def test_dictfield_strict(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user