示例#1
0
def get_deed(deed_reference):
    result = Deed.query.filter_by(token=str(deed_reference)).first()

    if result is None:
        abort(status.HTTP_404_NOT_FOUND)
    else:
        try:
            resp = get_document()
            return resp

        except:
            msg = str(sys.exc_info())
            application.app.logger.debug(msg)
            return msg
示例#2
0
def get_deed(deed_reference):
    result = Deed.query.filter_by(token=str(deed_reference)).first()

    if result is None:
        abort(status.HTTP_404_NOT_FOUND)
    else:
        try:
            resp = get_document()
            return resp

        except:
            msg = str(sys.exc_info())
            LOGGER.log(msg)
            return msg
示例#3
0
    def test_get_document(self):
        with app.app_context():
            with app.test_request_context():
                resp = get_document()

                self.assertEqual(str(resp.mimetype), "application/pdf")
    def test_get_document(self):
        with app.app_context():
            with app.test_request_context():
                resp = get_document()

                self.assertEqual(str(resp.mimetype), "application/pdf")