def setup_class(cls):
     cls.url_root = "http://127.0.0.1:5000/"
     with app.app_context():
         db.create_all()
         app.logger.info("Database initialized")
         helpers.insert_test_data_into_db_table(Resources)
         helpers.insert_test_data_into_db_table(Users)
         helpers.insert_test_data_into_db_table(Bookings)
Пример #2
0
    def client(self):
        """ Fixture returning Flask testing client.

        Returns:
            testing_client (Flask):
        """
        testing_client = app.test_client()
        ctx = app.app_context()
        ctx.push()
        yield testing_client
        ctx.pop()
 def teardown_class(cls):
     with app.app_context():
         db.session.remove()
         db.drop_all()
         app.logger.info("Database dropped")
 def client(self):
     testing_client = app.test_client()
     ctx = app.app_context()
     ctx.push()
     yield testing_client
     ctx.pop()