Esempio n. 1
0
    def setUp(self):
        """Define test variables and initialize app."""
        self.app = create_app()
        self.client = self.app.test_client
        self.database_name = "trivia_test"
        self.database_path = "postgres://{}:{}@{}/{}".format(
            'postgres', '1234', 'localhost:5432', self.database_name)
        setup_db(self.app, self.database_path)

        self.new_question = {
            'question': 'How are you ?',
            'answer': 'fine thank you',
            'category': '1',
            'difficulty': 1
        }

        # binds the app to the current context
        with self.app.app_context():
            self.db = SQLAlchemy()
            self.db.init_app(self.app)
            # create all tables
            self.db.create_all()
def client():
    app = create_app()
    app.debug = True
    app.testing = True
    app = app.test_client()
    return app
Esempio n. 3
0
def client():
    app = create_app()
    test_app = app.test_client()
    return test_app
Esempio n. 4
0
from flaskr import app


app = app.create_app()