

def test_bad_content_type(self):
    data = {
        'a': 1,
    }
    app = flask.Flask(__name__)
    with app.test_request_context(method='POST', content_type='application/x-plist', headers={
        'Accept': 'application/x-protobuf',
    }):

        @api(protobuf(receives=Person))
        def view_method():
            return data
        with self.assertRaises(UnsupportedMediaType):
            (response, status_code, headers) = view_method()

dataset/ETHPy150Open keenbrowne/flask-pbj/tests.py TestProtobuf.test_bad_content_type/original