def test_reject_provider(): global org_id global ruser_id r = provider_reg(remail, '9845596200', pname, org_id, csr) assert r['success'] == True assert r['status_code'] == 200 r = untrusted.get_provider_regs() assert r['success'] == True assert r['status_code'] == 200 providers = r['response'] for i in providers: if i['email'] == remail: assert i['status'] == 'pending' ruser_id = i['id'] r = untrusted.update_provider_status(ruser_id, 'rejected') assert r['success'] == True assert r['status_code'] == 200
def test_approve_provider(): global user_id r = untrusted.update_provider_status(user_id, 'approved') assert r['success'] == True assert r['status_code'] == 200
r = untrusted.get_provider_regs("approved") assert r['status_code'] in [200, 400] if r['status_code'] == 200: providers = r['response'] for i in providers: assert i['email'] != email # should not be in rejected r = untrusted.get_provider_regs("rejected") assert r['status_code'] in [200, 400] if r['status_code'] == 200: providers = r['response'] for i in providers: assert i['email'] != email r = untrusted.update_provider_status(user_id, 'approved') assert r['success'] == True assert r['status_code'] == 200 r = untrusted.get_provider_regs("approved") assert r['success'] == True assert r['status_code'] == 200 providers = r['response'] r = any(i['email'] == email and i['status'] == 'approved' for i in providers) assert r == True # should not be in pending r = untrusted.get_provider_regs("pending") assert r['status_code'] in [200, 400] if r['status_code'] == 200: providers = r['response']