From b41f624a57d8a47912ea6bb7a912a21461c8272b Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Wed, 17 Nov 2021 16:12:06 +0100 Subject: [PATCH] new test in master (?) --- evapp/tests.py | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/evapp/tests.py b/evapp/tests.py index 70a0408..6b6020b 100644 --- a/evapp/tests.py +++ b/evapp/tests.py @@ -5,7 +5,7 @@ from django.conf import settings from django.http import HttpResponse from django.core import mail -from .forms import ITForm, WorkingForm, OfficeForm, DummyForm +from .forms import ITForm, WorkingForm, OfficeForm, DummyForm, OffboardingForm class LoginTestCase(TestCase): def setUp(self): @@ -45,8 +45,8 @@ class LoginTestCase(TestCase): self.assertContains(self.response, 'Programme', status_code=200) self.assertContains(self.response, 'Kommunikation und Events', status_code=200) - def testWizzard(self): - ''' this test goes through the whole process of the EvaFormView from start to end ''' + def test_wizzard_in(self): + ''' this test goes through the whole onboarding process of the EvaFormView from start to end ''' self.assertEqual(200, self.response.status_code) @@ -55,6 +55,7 @@ class LoginTestCase(TestCase): '0-firstname': 'Ara', '0-lastname': 'Seva', '0-department': 'CENT', + '0-choice': 'IN' }, WorkingForm) response = self._postform({ @@ -83,8 +84,39 @@ class LoginTestCase(TestCase): 'eva_form_view-current_step': '5', }, DummyForm) + def test_wizzard_out(self): + ''' this test goes through the whole offboarding process of the EvaFormView from start to end ''' + + self.assertEqual(200, self.response.status_code) + + response = self._postform({ + 'eva_form_view-current_step': '0', + '0-firstname': 'Ara', + '0-lastname': 'Seva', + '0-department': 'CENT', + '0-choice': 'OUT' + }, OffboardingForm) + + response = self._postform({ + 'eva_form_view-current_step': '4', + '4-lastdate_employment': '2021-01-01', + '4-date_returning': '2021-01-01', + '4-lastdate_bvg': '2021-01-01', + '4-lastdate_bahncard': '2021-01-01', + '4-google-ownership': None, + '4-google-autoresponder': None, + '4-delete-account-later-at': None, + + + }, DummyForm) + + response = self._postform({ + 'eva_form_view-current_step': '5', + }, DummyForm) + + def test_mail(self): - self.testWizzard() + self.test_wizzard_in() # print(mail.outbox) self.assertGreater(len(mail.outbox), 2) self.assertIn("Ara Seva", mail.outbox[0].subject)