From 55db7b2ceb27d64ea7db89f8033a887cd3869afc Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Tue, 18 Apr 2023 15:31:48 +0200 Subject: [PATCH] Updated unit test --- modoboa/core/forms.py | 2 +- modoboa/core/tests/test_core.py | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/modoboa/core/forms.py b/modoboa/core/forms.py index a52bb8610..3c1d8e0de 100644 --- a/modoboa/core/forms.py +++ b/modoboa/core/forms.py @@ -49,7 +49,7 @@ class ProfileForm(forms.ModelForm): widget=forms.PasswordInput(attrs={"class": "form-control"}) ) - class Meta(object): + class Meta: model = User fields = ("first_name", "last_name", "language", "phone_number", "secondary_email") diff --git a/modoboa/core/tests/test_core.py b/modoboa/core/tests/test_core.py index a0c6a36bf..c722432da 100644 --- a/modoboa/core/tests/test_core.py +++ b/modoboa/core/tests/test_core.py @@ -148,15 +148,26 @@ class ProfileTestCase(ModoTestCase): self.ajax_post( reverse("core:user_profile"), - {"oldpassword": "toto", + {"language": "en", + "oldpassword": "toto", "confirmation": "tutu"}, status=400 ) self.ajax_post( reverse("core:user_profile"), - {"oldpassword": "toto", - "newpassword": "tutu", "confirmation": "tutu"}, + {"language": "en", + "oldpassword": "toto", + "newpassword": "tutu"}, + status=400 + ) + + self.ajax_post( + reverse("core:user_profile"), + {"language": "en", + "oldpassword": "toto", + "newpassword": "tutu", + "confirmation": "tutu"}, status=400 )