def test_user_login():
url = app_url + "/auth/login/" headers = {'Content-type': 'application/json;charset=utf8'} data = {"username":"345.com","password":"123"} r = requests.post(url, headers=headers, data=json.dumps(data, ensure_ascii=False).encode('utf8')) print (r.text) print (r.status_code)
def get_organization_sdp_list(): url = app_url + "/api/organization_sdps/632af821-2d30-4eb7-a7ec-c94d921e43fd/all/" headers = {"Authorization": "Token 9958dfad2bac82ca4fa81e27f638550e37e8c3d9", 'Content-type': 'application/json;charset=utf8'} r = requests.get(url, headers=headers) print (r.text) print (r.status_code)