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

Method test_set_enum

tests/fields/test_enum_field.py:41–45  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

39 assert get_as_pymongo(model) == {"_id": model.id, "status": "new"}
40
41 def test_set_enum(self):
42 ModelWithEnum.drop_collection()
43 ModelWithEnum(status=Status.NEW).save()
44 assert ModelWithEnum.objects(status=Status.NEW).count() == 1
45 assert ModelWithEnum.objects.first().status == Status.NEW
46
47 def test_set_by_value(self):
48 ModelWithEnum.drop_collection()

Callers

nothing calls this directly

Calls 6

ModelWithEnumClass · 0.85
drop_collectionMethod · 0.80
saveMethod · 0.45
countMethod · 0.45
objectsMethod · 0.45
firstMethod · 0.45

Tested by

no test coverage detected