def test_success_org_reg(): # success global org_id r = untrusted.organization_reg(org) assert r['success'] == True assert r['status_code'] == 200 org_id = r['response']['organizations'][0]['id']
def test_reg_same_org(): # same website r = untrusted.organization_reg(org) assert r['success'] == False assert r['status_code'] == 403
def test_invalid_domain(): # invalid domain borg["website"] = "abc$9091.oa32.com.co.434" r = untrusted.organization_reg(borg) assert r['success'] == False assert r['status_code'] == 400
def test_invalid_name(): # invalid name borg["name"] = "" r = untrusted.organization_reg(borg) assert r['success'] == False assert r['status_code'] == 400
def test_invalid_country(): # invalid country borg["country"] = "Karnataka" r = untrusted.organization_reg(borg) assert r['status_code'] == 400
def test_invalid_state(): # invalid state borg["state"] = "Karnataka" r = untrusted.organization_reg(borg) assert r['success'] == False assert r['status_code'] == 400
org = { "name": "TESTING", "city": "Bengaluru", "state": "KA", "country": "IN", "website": website } org_id = 0 user_id = 0 ruser_id = 0 borg = org.copy() # invalid state borg["state"] = "Karnataka" r = untrusted.organization_reg(borg) assert r['success'] == False assert r['status_code'] == 400 # invalid country borg["country"] = "Karnataka" r = untrusted.organization_reg(borg) assert r['status_code'] == 400 # invalid name borg["name"] = "" r = untrusted.organization_reg(borg) assert r['success'] == False assert r['status_code'] == 400 # invalid domain