def test_extend_is_deprecated(self): parent = Model('Parent', { 'name': fields.String, 'age': fields.Integer, 'birthdate': fields.DateTime, }) with pytest.warns(DeprecationWarning): child = parent.extend('Child', { 'extra': fields.String, }) assert child.__schema__ == { 'properties': { 'name': { 'type': 'string' }, 'age': { 'type': 'integer' }, 'birthdate': { 'type': 'string', 'format': 'date-time' }, 'extra': { 'type': 'string' } }, 'type': 'object' }
def test_extend_is_deprecated(self): parent = Model( "Parent", { "name": fields.String, "age": fields.Integer, "birthdate": fields.DateTime, }, ) with pytest.warns(DeprecationWarning): child = parent.extend("Child", {"extra": fields.String,}) assert child.__schema__ == { "properties": { "name": {"type": "string"}, "age": {"type": "integer"}, "birthdate": {"type": "string", "format": "date-time"}, "extra": {"type": "string"}, }, "type": "object", }