From 8cd195a33650310c9941080f1306f87222503e28 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Mon, 20 Sep 2021 13:40:26 +0200 Subject: [PATCH] test for mail sending added --- TODO | 2 -- evapp/tests.py | 10 ++++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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):