diff options
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r-- | ishtar_common/tests.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 5692c9863..8fd5ac9e1 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -4307,6 +4307,41 @@ class NewItems(TestCase): self.assertEqual(person.author.count(), 1) +class PersonWizardTest(WizardTest, TestCase): + fixtures = [ + FIXTURE_AUTH_PATH + "fixtures/initial_data-auth-fr.json", + LIB_BASE_PATH + "ishtar_common/fixtures/initial_data-fr.json", + ] + url_name = "person_creation" + wizard_name = "person_wizard" + steps = views.person_creation_wizard_steps + model = models.Person + redirect_url = "/person_modification/selec-person_modification?open_item={last_id}" + form_datas = [ + WizardTestFormData( + "Add a person", + form_datas={ + "identity": { + "surname": "Forname", + "name": "name", + "title": None, + "person_types": [], + } + }, + ), + ] + + def pre_wizard(self): + self.number = models.Person.objects.count() + super().pre_wizard() + + def post_wizard(self): + self.assertEqual(models.Person.objects.count(), self.number + 1) + person = models.Person.objects.order_by("-pk").all()[0] + self.assertEqual(person.surname, "Forname") + self.assertEqual(person.name, "name") + + class AccountWizardTest(WizardTest, TestCase): fixtures = [ FIXTURE_AUTH_PATH + "fixtures/initial_data-auth-fr.json", |