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

Method test_reset

tests/queryset/test_field_list.py:53–61  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

51 assert q.as_dict() == {"x": 1, "y": 1, "c": 1}
52
53 def test_reset(self):
54 q = QueryFieldList(always_include=["x", "y"])
55 q += QueryFieldList(fields=["a", "b", "x"], value=QueryFieldList.EXCLUDE)
56 q += QueryFieldList(fields=["b", "c"], value=QueryFieldList.ONLY)
57 assert q.as_dict() == {"x": 1, "y": 1, "c": 1}
58 q.reset()
59 assert not q
60 q += QueryFieldList(fields=["b", "c"], value=QueryFieldList.ONLY)
61 assert q.as_dict() == {"x": 1, "y": 1, "b": 1, "c": 1}
62
63 def test_using_a_slice(self):
64 q = QueryFieldList()

Callers

nothing calls this directly

Calls 3

as_dictMethod · 0.95
resetMethod · 0.95
QueryFieldListClass · 0.90

Tested by

no test coverage detected