MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / test_modify

Method test_modify

tests/queryset/test_modify.py:27–33  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

25 assert list(Doc._collection.find().sort("id")) == docs
26
27 def test_modify(self):
28 Doc(id=0, value=0).save()
29 doc = Doc(id=1, value=1).save()
30
31 old_doc = Doc.objects(id=1).modify(set__value=-1)
32 assert old_doc.to_json() == doc.to_json()
33 self._assert_db_equal([{"_id": 0, "value": 0}, {"_id": 1, "value": -1}])
34
35 def test_modify_full_response_raise_value_error_for_recent_mongo(self):
36 Doc(id=0, value=0).save()

Callers

nothing calls this directly

Calls 6

_assert_db_equalMethod · 0.95
DocClass · 0.70
saveMethod · 0.45
modifyMethod · 0.45
objectsMethod · 0.45
to_jsonMethod · 0.45

Tested by

no test coverage detected