walkthrough test completed

This commit is contained in:
Benni Bärmann 2021-09-20 12:15:13 +02:00
parent 5cda8400cc
commit 61523c32b2
2 changed files with 22 additions and 11 deletions

2
TODO
View File

@ -1,7 +1,5 @@
* remove dot before "Nextcloud" at login page.
* test for complete run with all forms
* test for mail sending
* firstname lastname in subject

View File

@ -2,8 +2,9 @@ from django.test import TestCase
from django.test import Client
from django.contrib.auth.models import User
from django.conf import settings
from django.http import HttpResponse
from .forms import ITForm, WorkingForm, OfficeForm
from .forms import ITForm, WorkingForm, OfficeForm, DummyForm
class LoginTestCase(TestCase):
def setUp(self):
@ -25,15 +26,18 @@ class LoginTestCase(TestCase):
def _postform(self, data, expected_form):
response = self.client.post('/', data, follow=True)
# print(type(response))
self.assertEqual(200, self.response.status_code)
if not type(response) == HttpResponse:
if 'form' in response.context:
self.assertFalse(response.context['form'].errors)
else:
raise "NO FORM FOUND"
return response
self.assertEqual(
type(response.context['wizard']['form']),
expected_form
)
return response
def testWizzard(self):
''' this test goes thru the whole process of the EvaFormView from start to end '''
@ -64,6 +68,15 @@ class LoginTestCase(TestCase):
'2-language': 'GER'
}, OfficeForm)
response = self._postform({
'eva_form_view-current_step': '3',
'3-transponder': 'NORM'
}, DummyForm)
repsone = self._postform({
'eva_form_view-current_step': '5',
}, DummyForm)
class NoLoginTestCase(TestCase):
def setUp(self):