def to_son(self): field = UUIDField() uuid = uuid4() expect(field.to_son(uuid)).to_equal(uuid) expect(field.to_son(str(uuid))).to_equal(uuid)
def test_to_son(self): field = UUIDField() uuid = uuid4() expect(field.to_son(uuid)).to_equal(uuid) expect(field.to_son(str(uuid))).to_equal(uuid) expect(field.to_son(None)).to_be_null()