From bbd1e7ff6d7f34c72db04bb8dcdfa91b80ffebf1 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Tue, 14 Sep 2021 11:58:22 +0200 Subject: [PATCH] new test mac should have mac os --- evapp/tests.py | 11 ++++++++--- evapp/views.py | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/evapp/tests.py b/evapp/tests.py index f71ae35..519ce75 100644 --- a/evapp/tests.py +++ b/evapp/tests.py @@ -1,9 +1,8 @@ from django.test import TestCase -# import unittest from django.test import Client - from django.contrib.auth.models import User -#from django.urls import reverse + +from .forms import ITForm class LoginTestCase(TestCase): def setUp(self): @@ -29,3 +28,9 @@ class NoLoginTestCase(TestCase): self.assertEqual(response.status_code, 302) response2 = self.client.get(response.url) self.assertContains( response2, 'Bitte via Wolke einloggen:', status_code=200) + +class ITFORMTestCase(TestCase): + def test_mac(self): + form = ITForm(data={"vendor": 'MAC', 'os': 'UBU'}) + print (form.errors) + self.assertEqual(form.errors['os'], ['A MAC should have Mac OS installed']) diff --git a/evapp/views.py b/evapp/views.py index 02d29a3..6c8b902 100644 --- a/evapp/views.py +++ b/evapp/views.py @@ -72,7 +72,7 @@ class EvaFormView(LoginRequiredMixin, CookieWizardView): data = super().get_all_cleaned_data() self.generate_email(data) - print("delete CHOICE FROM DATA") + # print("delete CHOICE FROM DATA") if 'choice' in data: del data['choice'] return data