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

Method _get_basedict

tests/test_datastructures.py:27–34  ·  view source on GitHub ↗

Get a BaseList bound to a fake document instance

(dict_items)

Source from the content-addressed store, hash-verified

25class TestBaseDict:
26 @staticmethod
27 def _get_basedict(dict_items):
28 """Get a BaseList bound to a fake document instance"""
29 fake_doc = DocumentStub()
30 base_list = BaseDict(dict_items, instance=None, name="my_name")
31 base_list._instance = (
32 fake_doc # hack to inject the mock, it does not work in the constructor
33 )
34 return base_list
35
36 def test___init___(self):
37 class MyDoc(Document):

Calls 2

BaseDictClass · 0.90
DocumentStubClass · 0.85

Tested by

no test coverage detected