StarList uses proper inheritance and properly passes initial values and attributes + add empty comment clause

This commit is contained in:
2026-08-21 14:22:46 +02:00
parent 12135b5c22
commit 82e71263dd
7 changed files with 142 additions and 83 deletions
+18
View File
@@ -339,6 +339,24 @@ class TestUVCommentCreationAndDisplay(TestCase):
response = self.client.get(self.ue_url)
self.assertContains(response, text="Superbe UE")
def test_create_ue_empty_comment_fail(self):
self.client.force_login(self.tutu)
response = self.client.post(
self.ue_url,
{
"author": self.tutu.id,
"ue": UE.objects.get(code="PA00").id,
"grade_global": -1,
"grade_utility": -1,
"grade_interest": -1,
"grade_teaching": -1,
"grade_work_load": -1,
"comment": "",
},
)
assert response.status_code == 200
self.assertInHTML("Un commentaire d'UE ne peut pas être vide.", response.text)
def test_create_ue_comment_unauthorized_fail(self):
nb_comments = self.ue.comments.count()
# Test with anonymous user