def base_client() -> Iterator[FlaskClient]: with warnings.catch_warnings(): warnings.simplefilter("ignore") app = create_app(Path.cwd(), "Test") app_context = app.app_context() app_context.push() Session.close() yield app.test_client()
def base_client(): with warnings.catch_warnings(): warnings.simplefilter("ignore") app = create_app("test") app_context = app.app_context() app_context.push() Session.close() yield app.test_client()
def user_client() -> Iterator[FlaskClient]: with warnings.catch_warnings(): warnings.simplefilter("ignore") app = create_app(Path.cwd(), "Test") app_context = app.app_context() app_context.push() Session.close() client = app.test_client() with app.app_context(): client.post( "/login", data={ "name": "admin", "password": "******", "authentication_method": "Local User", }, ) yield client