mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
methode clean dans MergeForm
fixed formatting Update rootplace/forms.py Co-authored-by: thomas girod <56346771+imperosol@users.noreply.github.com> Check that a user cannot be merged into itself ajout des traductions changed test language to french Check that a user cannot be merged into itself
This commit is contained in:
@ -22,6 +22,7 @@ from django.utils.timezone import localtime, now
|
||||
from club.models import Club
|
||||
from core.models import Group, User
|
||||
from counter.models import Counter, Customer, Product, Refilling, Selling
|
||||
from rootplace.forms import MergeForm
|
||||
from subscription.models import Subscription
|
||||
|
||||
|
||||
@ -79,6 +80,15 @@ class TestMergeUser(TestCase):
|
||||
sas_admin.id,
|
||||
}
|
||||
|
||||
def test_identical_accounts(self):
|
||||
form = MergeForm(data={"user1": self.to_keep.id, "user2": self.to_keep.id})
|
||||
assert not form.is_valid()
|
||||
assert "__all__" in form.errors
|
||||
assert (
|
||||
"Vous ne pouvez pas fusionner deux utilisateurs identiques."
|
||||
in form.errors["__all__"]
|
||||
)
|
||||
|
||||
def test_both_subscribers_and_with_account(self):
|
||||
Customer(user=self.to_keep, account_id="11000l", amount=0).save()
|
||||
Customer(user=self.to_delete, account_id="12000m", amount=0).save()
|
||||
|
Reference in New Issue
Block a user