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
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
def test_get_document(self): with app.app_context(): with app.test_request_context(): resp = get_document() self.assertEqual(str(resp.mimetype), "application/pdf")