def web_client(): with app.test_client() as client: client.set_cookie('', 'SID', value='GOmrIgCkWQx8Y4FJPxAxFUP75RKSB1XYUa4A') response = client.get('/api/ping', buffered=True) assert response.status_code == 200 response = client.get('/api/login', buffered=True) assert response.status_code == 200 return client
def web_client(): with app.test_client() as client: client.set_cookie( '', 'SID', value='GOmrIgCkWQx8Y4FJPxAxFUP75RKSB1XYUa4A' ) response = client.get('/api/ping', buffered=True) assert response.status_code == 200 response = client.get('/api/login', buffered=True) assert response.status_code == 200 return client
def test_get_event(web_client): with app.test_client() as web_client: response = web_client.get('/api/ping', buffered=True) assert response.status_code == 200 web_client.set_cookie('', 'SID', value='GOmrIgCkWQx8Y4FJPxAxFUP75RKSB1XYUa4A') response = web_client.get('/api/login', buffered=True) print(response.status_code) assert response.status_code == 200 # test_login() # web_client.set_cookie('eleme.test', 'god_token', 'true') # web_client.set_cookie('eleme.test', 'god_uid', '485388') # web_client.set_cookie('eleme.test', 'user_id', '485388') # session['user_id'] = 485388 response = web_client.get('/api/banner/get_user_city_ids', headers=headers, buffered=True) print(response.status_code) assert response.status_code == 200 print(response.data)
def _api_helper(): from walis.server import app c = app.test_client() # noqa import IPython IPython.embed()
def web_client(): with app.test_client() as client: return client