import logging from ratemydorm import create_app gunicorn_error_logger = logging.getLogger('gunicorn.error') app = create_app() app.logger.handlers.extend(gunicorn_error_logger.handlers) app.logger.setLevel(logging.DEBUG) app.logger.debug('this will show in the log') app.debug = True if __name__ == "__main__": app.run()
def test_retrieve_feature_id_from_text(self): with create_app().app_context() as ctx: features = ['ac', 'bathroom'] expected = [3, 2] ids = get_feature_ids(features) self.assertCountEqual(ids, expected)
def test_retrieve_with_one_feature(self): with create_app().app_context() as ctx: features = ['bathroom'] get_feature_ids(features)
def test_get_last_id(self): with create_app().app_context() as ctx: id = get_last_id() self.assertIsInstance(id, int)
def setUp(self): app = create_app() self.client = app.test_client() app.config['TESTING'] = True self.client.testing = True