FIX questions test
@@ -8,18 +8,11 @@ def test_questions_public():
questions = s.get(f"/public/questions/get/{assignment_id}")["questions"]
s.get(f"/public/questions/get/notanid", should_fail=True)
- for index, question in enumerate(questions):
- question_id = question["id"]
- s.post_json(f"/public/questions/save/{question_id}", json={"response": "test123"})
- s.post_json(
- f"/public/questions/save/{question_id}",
- json={"response": 1},
- should_fail=True,
- )
- s.post_json(
- f"/public/questions/save/{question_id}",
- json={"response": None},
- should_fail=True,
- )
- _questions = s.get(f"/public/questions/get/{assignment_id}")["questions"]
- assert _questions[index]["response"]["text"] == "test123"
+ questions[0]['response'] = {'text': ''}
+ s.post_json(f"/public/questions/save/{assignment_id}", json={"questions": questions})
+
+ questions[0]['response'] = {'text': 1}
+ s.post_json(f"/public/questions/save/{assignment_id}", json={"questions": questions}, should_fail=True)
+
+ questions[0]['response'] = {'text': None}
+ s.post_json(f"/public/questions/save/{assignment_id}", json={"questions": questions})
