def setUp(self): self.app = Setup.create_app() with self.app.test_request_context(): user = UserFactory() save_to_db(user) event = EventFactoryBasic() event.user_id = user.id save_to_db(event) # Authenticate User self.auth = {'Authorization': "JWT " + create_access_token(user.id, fresh=True)}
def setUp(self): self.app = Setup.create_app() with app.test_request_context(): user = UserFactory() db.session.add(user) db.session.commit() event = EventFactoryBasic() event.user_id = user.id db.session.add(event) db.session.commit() # Authenticate User self.auth = {'Authorization': "JWT " + str(_default_jwt_encode_handler(user), 'utf-8')}
def setUp(self): self.app = Setup.create_app() with app.test_request_context(): user = UserFactory() save_to_db(user) event = EventFactoryBasic() event.user_id = user.id save_to_db(event) # Authenticate User self.auth = { 'Authorization': "JWT " + str(_default_jwt_encode_handler(user), 'utf-8') }
def setUp(self): self.app = Setup.create_app()
def Setup(self): self.app = Setup.create_app()
def database(app): _db.create_all() set_settings(app_name='Open Event', app_environment=Environment.TESTING) yield _db Setup.drop_db()
def tearDownClass(cls) -> None: Setup.drop_db()
def setUpClass(cls) -> None: cls.app = Setup.create_app()
def tearDown(self) -> None: Setup.drop_db()
def setUp(self) -> None: self.app = Setup.create_app()
def tearDown(self): Setup.drop_db()
def database(app): _db.engine.execute('create extension if not exists citext') _db.create_all() set_settings(app_name='Open Event', app_environment=Environment.TESTING) yield _db Setup.drop_db()