diff --git a/TODO b/TODO index 9a7b97b..f3af4eb 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,3 @@ * remove dot before "Nextcloud" at login page. -* test for mail sending - * firstname lastname in subject diff --git a/evapp/tests.py b/evapp/tests.py index 194897e..a0fc6c5 100644 --- a/evapp/tests.py +++ b/evapp/tests.py @@ -3,6 +3,7 @@ from django.test import Client from django.contrib.auth.models import User from django.conf import settings from django.http import HttpResponse +from django.core import mail from .forms import ITForm, WorkingForm, OfficeForm, DummyForm @@ -40,7 +41,7 @@ class LoginTestCase(TestCase): return response def testWizzard(self): - ''' this test goes thru the whole process of the EvaFormView from start to end ''' + ''' this test goes through the whole process of the EvaFormView from start to end ''' self.assertEqual(200, self.response.status_code) @@ -73,10 +74,15 @@ class LoginTestCase(TestCase): '3-transponder': 'NORM' }, DummyForm) - repsone = self._postform({ + response = self._postform({ 'eva_form_view-current_step': '5', }, DummyForm) + def test_mail(self): + self.testWizzard() + # print(mail.outbox) + self.assertGreater(len(mail.outbox), 2) + self.assertIn("Ara Seva", mail.outbox[0].subject) class NoLoginTestCase(TestCase): def setUp(self):