WMDE
/
eva
forked from tohe/eva
7
1
Fork 0

new test for not yet existing debug mode warning

This commit is contained in:
Benni Bärmann 2021-09-14 08:29:45 +02:00
parent 6becd8278b
commit 39cee37be8
1 changed files with 8 additions and 3 deletions

View File

@ -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):