walkthrough test completed
This commit is contained in:
parent
5cda8400cc
commit
61523c32b2
2
TODO
2
TODO
|
@ -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
|
||||||
|
|
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue