MCPcopy Create free account
hub / github.com/MongoEngine/mongoengine / test_storage

Method test_storage

tests/fields/test_dict_field.py:14–22  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

12
13class TestDictField(MongoDBTestCase):
14 def test_storage(self):
15 class BlogPost(Document):
16 info = DictField()
17
18 BlogPost.drop_collection()
19
20 info = {"testkey": "testvalue"}
21 post = BlogPost(info=info).save()
22 assert get_as_pymongo(post) == {"_id": post.id, "info": info}
23
24 def test_validate_invalid_type(self):
25 class BlogPost(Document):

Callers

nothing calls this directly

Calls 4

get_as_pymongoFunction · 0.90
drop_collectionMethod · 0.80
BlogPostClass · 0.70
saveMethod · 0.45

Tested by

no test coverage detected