From b1b68ae68d605f0b2f4629466301d01f33f737fe Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Wed, 19 Jan 2022 13:36:19 +0100 Subject: [PATCH] added first translation test --- evapp/tests.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/evapp/tests.py b/evapp/tests.py index d509c3b..9117324 100644 --- a/evapp/tests.py +++ b/evapp/tests.py @@ -4,6 +4,7 @@ from django.contrib.auth.models import User from django.conf import settings from django.http import HttpResponse from django.core import mail +from django.utils import translation from .forms import ITForm, WorkingForm, OfficeForm, DummyForm @@ -13,9 +14,12 @@ class LoginTestCase(TestCase): self.user = User.objects.create_user('vladimir', 'vladimir@reiherzehe.com', 'reiherzehe') self.client.login(username='vladimir', password='reiherzehe') self.response = self.client.get('/') + with translation.override('en'): + self.response_en = self.client.get('/') def testLogin(self): self.assertContains(self.response, 'Du bist eingeloggt als vladimir@reiherzehe.com', status_code=200) + self.assertContains(self.response_en, 'You are logged in as vladimir@reiherzehe.com', status_code=200) def testDebugWarning(self): with self.settings(DEBUG=True):