From 39cee37be82867111fcb5c217731fad7bd52bd10 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Tue, 14 Sep 2021 08:29:45 +0200 Subject: [PATCH] new test for not yet existing debug mode warning --- evapp/tests.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/evapp/tests.py b/evapp/tests.py index 43d65cb..57431b5 100644 --- a/evapp/tests.py +++ b/evapp/tests.py @@ -9,11 +9,16 @@ class LoginTestCase(TestCase): def setUp(self): self.client = Client() self.user = User.objects.create_user('vladimir', 'vladimir@reiherzehe.com', 'reiherzehe') + self.client.login(username='vladimir', password='reiherzehe') + self.response = self.client.get('/') def testLogin(self): - self.client.login(username='vladimir', password='reiherzehe') - response = self.client.get('/') - self.assertContains(response, 'Du bist eingeloggt als vladimir@reiherzehe.com', status_code=200) + self.assertContains(self.response, 'Du bist eingeloggt als vladimir@reiherzehe.com', status_code=200) + + def testDebugWarning(self): + with self.settings(DEBUG=True): + self.assertContains(self.response, "WARNUNG! Test-MODUS aktiviert. Es werden keine Mails verschickt!", status_code=200) + class SimpleTest(TestCase): def setUp(self):