Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def test_type_with_array_tojson(self):
- class AType(object):
- attr = int
- def __init__(self, val):
- self.attr = val
- class BType(object):
- attr = [AType]
- def __init__(self, val):
- self.attr = val
- wsme.types.register_type(BType)
- wsme.rest.json.foo = True
- j = tojson(BType, [BType([AType(1)])])
- assert j == {'attr': [{'attr': 1}]}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement