def test_school_classcards_show_organization(client, web2py): """ Is the organization column showing when we have more than 1 organization """ populate_sys_organizations(web2py, 3) populate_school_classcards(web2py, 5) url = '/school_properties/classcards' client.get(url) assert client.status == 200 assert 'Organization' in client.text
def test_school_classcards_get_json(client, web2py): """ Are the class cards returned correctly? """ populate_api_users(web2py) populate_school_classcards(web2py, 2) url = base_url + '/api/school_classcards_get.json?user=test&key=test' page = urllib.urlopen(url).read() json = sj.loads(page) classcard = web2py.db.school_classcards(1) assert json['data'][0]['Name'] == classcard.Name
def test_school_classcards_get_json(client, web2py): """ Are the class cards returned correctly? """ populate_api_users(web2py) populate_school_classcards(web2py, 2) url = base_url + '/api/school_classcards_get.json?user=test&key=test' with urllib.request.urlopen(url) as page: content = page.read().decode('utf-8') json = sj.loads(content) classcard = web2py.db.school_classcards(1) assert json['data'][0]['Name'] == classcard.Name