From 11e0dc4a1af61d5eb1cccb5c8229a52681824c03 Mon Sep 17 00:00:00 2001 From: Matthew Gray <44288823+mmoomocow@users.noreply.github.com> Date: Wed, 13 Sep 2023 14:54:39 +1200 Subject: [PATCH] =?UTF-8?q?test(forms):=20=E2=9C=85=20Update=20tests=20to?= =?UTF-8?q?=20match=20last=20changes=20in=20b07a550?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Matthew Gray <44288823+mmoomocow@users.noreply.github.com> --- commendations/tests.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/commendations/tests.py b/commendations/tests.py index 67671e4..a63d2e3 100644 --- a/commendations/tests.py +++ b/commendations/tests.py @@ -208,11 +208,12 @@ def test_CommendationAdmin(self): commendation.students.add(self.student.student) commendation.save() - admin = CommendationAdmin(commendation, None) + admin = CommendationAdmin(Commendation, None) + studentList = admin.listStudents(commendation) self.assertEqual( - admin.students(commendation), - self.student.student.__str__(), - f"Commendation students was not set correctly, expected {self.student.student}, got {admin.students(commendation)}", + studentList, + self.student.student.user.first_name, + f"CommendationAdmin listStudents was not set correctly, expected {self.student.student.user.first_name}, got {studentList}", ) @@ -231,7 +232,7 @@ def test_giveCommendation_post_reason(self): "/commendations/award/", { "commendationType": Commendation.EXCELLENCE, - "students": [self.student.student.id], + "selectedStudents": str(self.student.student.id), "teacher": self.teacher.teacher.id, "reason": "Test commendation", "quickReason": "", @@ -257,7 +258,7 @@ def test_giveCommendation_post_no_reason(self): "/commendations/award/", { "commendationType": Commendation.EXCELLENCE, - "students": [self.student.student.id], + "selectedStudents": str(self.student.student.id), "teacher": self.teacher.teacher.id, "reason": "", "quickReason": "", @@ -283,7 +284,7 @@ def test_giveCommendation_post_reason_AND_quickReason(self): "/commendations/award/", { "commendationType": Commendation.EXCELLENCE, - "students": [self.student.student.id], + "selectedStudents": str(self.student.student.id), "teacher": self.teacher.teacher.id, "reason": "And very helpful", "quickReason": "Being truthful", @@ -309,7 +310,7 @@ def test_giveCommendation_post_only_quickReason(self): "/commendations/award/", { "commendationType": Commendation.EXCELLENCE, - "students": [self.student.student.id], + "selectedStudents": str(self.student.student.id), "teacher": self.teacher.teacher.id, "reason": "", "quickReason": "Being truthful",