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