Example #1
0
 def setUpClass(cls):
     app = create_app(__name__)
     if not app.config['TESTING']:
         raise Exception('Not in Testing context')
     engine = sqlalchemy.create_engine(app.config['MASTER_DATABASE_URI'])
     statements = [
         'DROP DATABASE IF EXISTS {}'.format(app.config['TEST_DATABASE_NAME']),
         'CREATE DATABASE {}'.format(app.config['TEST_DATABASE_NAME']),
     ]
     _batch_sql(engine, statements)
     engine = sqlalchemy.create_engine(app.config['SQLALCHEMY_DATABASE_URI'])
     statements = [
         'CREATE TABLE test (id integer PRIMARY KEY, value integer)',
         'INSERT INTO test SELECT generate_series(1, 100), ROUND(random() * 10)',
     ]
     _batch_sql(engine, statements)
Example #2
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import absolute_import, division, print_function, unicode_literals

from navigator.app import create_app

if __name__ == "__main__":
    app = create_app(__name__)
    app.run(debug=True)
Example #3
0
 def setUp(self):
     app = create_app(__name__)
     self.client = app.test_client()