MCPcopy Index your code
hub / github.com/diffgram/diffgram / create_default_testing_app

Function create_default_testing_app

default/tests/test_utils/testing_setup.py:16–37  ·  view source on GitHub ↗

Creates flask app for testing the walrus with all the appropriate configuration :return:

()

Source from the content-addressed store, hash-verified

14 raise Exception('DIFFGRAM_SYSTEM_MODE must be in "testing" mode to perform any kind of test')
15
16def 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
40class DiffgramBaseTestCase(unittest.TestCase):

Callers 1

setUpClassMethod · 0.85

Calls 1

do_routes_importingFunction · 0.90

Tested by

no test coverage detected