forked from beba/foerderbarometer
41 lines
1006 B
Python
41 lines
1006 B
Python
|
|
from django.test import TestCase
|
||
|
|
|
||
|
|
from input.utils.testing import request
|
||
|
|
|
||
|
|
|
||
|
|
class ViewTestCase(TestCase):
|
||
|
|
|
||
|
|
def test_index(self):
|
||
|
|
request(self, 'index')
|
||
|
|
|
||
|
|
def test_extern(self):
|
||
|
|
request(self, 'extern')
|
||
|
|
|
||
|
|
def test_extern_travel(self):
|
||
|
|
data = {
|
||
|
|
'extern_view-current_step': 0,
|
||
|
|
'0-realname': 'Test',
|
||
|
|
'0-email': 'test@example.com',
|
||
|
|
'0-choice': 'TRAV',
|
||
|
|
'0-check': True,
|
||
|
|
}
|
||
|
|
|
||
|
|
response = request(self, 'extern', data=data)
|
||
|
|
|
||
|
|
self.assertContains(response, 'Transportmittel')
|
||
|
|
|
||
|
|
data = {
|
||
|
|
'extern_view-current_step': 1,
|
||
|
|
'project_name': 'Test',
|
||
|
|
'transport': 'BAHN',
|
||
|
|
'travelcost': 10,
|
||
|
|
'checkin': '2025-01-01',
|
||
|
|
'checkout': '2025-01-02',
|
||
|
|
'hotel': 'TRUE',
|
||
|
|
'notes': '',
|
||
|
|
}
|
||
|
|
|
||
|
|
response = request(self, 'extern', data=data)
|
||
|
|
|
||
|
|
self.assertContains(response, 'Deine Anfrage wurde gesendet.')
|