fix a load of test
This commit is contained in:
@@ -332,11 +332,11 @@ def test_exams(db, client):
|
||||
search_exam = (
|
||||
cid_scores_soup.find("div", {"id": "exam-assigned"})
|
||||
.find("ul", {"class": exam.app_name})
|
||||
.find_all("li", attrs={"data-exam-id": exam.pk})
|
||||
.find("li", attrs={"data-exam-id": exam.pk})
|
||||
)
|
||||
assert search_exam
|
||||
assert exam.name in str(search_exam)
|
||||
assert "Active" in str(search_exam)
|
||||
assert len(search_exam.find("button", {"class": "start-button"})) > 0
|
||||
# assert "Active" in assigned_exams # check it is active
|
||||
|
||||
invalid_exam = cid_scores_soup.find_all(
|
||||
|
||||
@@ -241,7 +241,10 @@ def test_cid_management(client, create_cid_manager, django_user_model):
|
||||
|
||||
for url in urls:
|
||||
response = client.get(url)
|
||||
assert response.status_code == 403
|
||||
if response.status_code == 302:
|
||||
assert "accounts/login/" in response.url
|
||||
else:
|
||||
assert response.status_code == 403
|
||||
|
||||
pass
|
||||
|
||||
@@ -250,6 +253,7 @@ def test_cid_management(client, create_cid_manager, django_user_model):
|
||||
client.force_login(cid_manager)
|
||||
|
||||
for url in urls:
|
||||
print(url)
|
||||
response = client.get(url)
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
Reference in New Issue
Block a user