WMDE
/
eva
forked from tohe/eva
7
1
Fork 0

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. * remove dot before "Nextcloud" at login page.
* test for complete run with all forms
* test for mail sending * test for mail sending
* firstname lastname in subject * firstname lastname in subject

View File

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