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

Method _get_baselist

tests/test_datastructures.py:163–170  ·  view source on GitHub ↗

Get a BaseList bound to a fake document instance

(list_items)

Source from the content-addressed store, hash-verified

161class TestBaseList:
162 @staticmethod
163 def _get_baselist(list_items):
164 """Get a BaseList bound to a fake document instance"""
165 fake_doc = DocumentStub()
166 base_list = BaseList(list_items, instance=None, name="my_name")
167 base_list._instance = (
168 fake_doc # hack to inject the mock, it does not work in the constructor
169 )
170 return base_list
171
172 def test___init___(self):
173 class MyDoc(Document):

Calls 2

BaseListClass · 0.90
DocumentStubClass · 0.85

Tested by

no test coverage detected