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(): with warnings.catch_warnings(): warnings.simplefilter("ignore") app = create_app("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
from eNMS.framework import create_app app = create_app()