示例#1
0
文件: wsgi.py 项目: IJumpAround/418
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()
示例#2
0
 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)
示例#3
0
 def test_retrieve_with_one_feature(self):
     with create_app().app_context() as ctx:
         features = ['bathroom']
         get_feature_ids(features)
示例#4
0
 def test_get_last_id(self):
     with create_app().app_context() as ctx:
         id = get_last_id()
         self.assertIsInstance(id, int)
示例#5
0
 def setUp(self):
     app = create_app()
     self.client = app.test_client()
     app.config['TESTING'] = True
     self.client.testing = True