Ignore:
Timestamp:
Apr 22, 2019, 5:39:46 PM (8 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, master
Children:
041e464
Parents:
5e4cb73
Message:

Improved adding Water UI in mapservice-webclient

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mapservice/src-gen/openapi_server/test/__init__.py

    r5e4cb73 rbe25db1  
    22
    33import connexion
     4from flask_cors import CORS
    45from flask_testing import TestCase
    56
    67from openapi_server.encoder import JSONEncoder
    78
     9from openapi_server.server_impl.database.Model import db, db_test_setup
    810
    911class BaseTestCase(TestCase):
     12        def create_app(self):
     13                logging.getLogger('connexion.operation').setLevel('ERROR')
     14                app = connexion.App(__name__, specification_dir='../openapi/')
     15                application = app.app
     16                CORS(application)
     17                application.json_encoder = JSONEncoder
     18                app.add_api('openapi.yaml')
    1019
    11     def create_app(self):
    12         logging.getLogger('connexion.operation').setLevel('ERROR')
    13         app = connexion.App(__name__, specification_dir='../openapi/')
    14         app.app.json_encoder = JSONEncoder
    15         app.add_api('openapi.yaml')
    16         return app.app
     20                application.config.from_object('openapi_server.server_impl.Config.TestingConfig')
     21                db.init_app(application)
     22                application.app_context().push()
     23               
     24                return application
     25
     26        def setUp(self):
     27                db.drop_all()
     28                db_test_setup()
     29       
     30        def tearDown(self):
     31                db.session.remove()
     32                db.drop_all()
Note: See TracChangeset for help on using the changeset viewer.