def test_overlapping_classes_get_count_all(client, web2py): """ Test if a span badge with correct count is on the manage page """ populate_workshop_activity_overlapping_class(web2py) url = '/events/activities?wsID=1' client.get(url) assert client.status == 200 assert '<span class="badge">1</span>' in client.text
def test_overlapping_classes(client, web2py): """ Test list of overlapping classes """ populate_workshop_activity_overlapping_class(web2py) url = '/events/overlapping_classes?wsID=1' client.get(url) assert client.status == 200 # if we have a td with this class, we know the list isn't empty assert '<td class="td_status_marker">' in client.text
def test_overlapping_classes_cancel_all(client, web2py): """ Check if the cancel all overlapping classes function works """ populate_workshop_activity_overlapping_class(web2py) url = '/events/overlapping_classes_cancel_all?wsID=1' client.get(url) assert client.status == 200 # make sure the correct entry is in db.classes_cancelled query = (web2py.db.classes_otc.classes_id == 1) & \ (web2py.db.classes_otc.ClassDate == '2014-01-06') & \ (web2py.db.classes_otc.Status == 'cancelled') assert web2py.db(query).count() == 1