Creates flask app for testing the walrus with all the appropriate configuration :return:
()
| 14 | raise Exception('DIFFGRAM_SYSTEM_MODE must be in "testing" mode to perform any kind of test') |
| 15 | |
| 16 | def create_default_testing_app(): |
| 17 | """ |
| 18 | Creates flask app for testing the walrus |
| 19 | with all the appropriate configuration |
| 20 | :return: |
| 21 | """ |
| 22 | |
| 23 | do_routes_importing() |
| 24 | from methods import routes as routes_blueprint |
| 25 | from shared.helpers.security import limiter |
| 26 | from sqlalchemy import create_engine |
| 27 | from sqlalchemy.orm import sessionmaker |
| 28 | from shared.settings import settings |
| 29 | app = Flask('Default Test App', |
| 30 | static_folder="./dist/static", |
| 31 | template_folder="./dist") |
| 32 | # sslify = SSLify(app, subdomains=True) |
| 33 | app.register_blueprint(routes_blueprint) |
| 34 | app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(days=14) |
| 35 | app.secret_key = settings.SECRET_KEY |
| 36 | limiter.init_app(app) |
| 37 | return app |
| 38 | |
| 39 | |
| 40 | class DiffgramBaseTestCase(unittest.TestCase): |
no test coverage detected