def test_handles_enums_in_json_transformation(self): Thing = Enum("Thing", "one two") s = Structure(thing=Thing.one) expect(s.to_json()).to(equal('{"thing": "Thing.one"}'))
def test_serializes_nones_as_json_nulls(self): s = Structure(beans=None) expect(json.loads(s.to_json())).to(equal({"beans": None}))