added language testing for en (besides en-us)

This commit is contained in:
Benni Bärmann 2022-01-27 13:26:54 +01:00
parent 1cb419f73f
commit 22e33327fc
1 changed files with 3 additions and 6 deletions

View File

@ -17,13 +17,10 @@ class LoginTestCase(TestCase):
def testLogin(self): def testLogin(self):
self.assertContains(self.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)
# self.client.cookies.load({settings.LANGUAGE_COOKIE_NAME: 'en'})
#with translation.override('en'):
response_en = self.client.get('/', HTTP_ACCEPT_LANGUAGE='en-us') response_en = self.client.get('/', HTTP_ACCEPT_LANGUAGE='en-us')
#self.response_en = self.client.get('/') self.assertContains(response_en, 'You are logged in as vladimir@reiherzehe.com', status_code=200)
print('START') self.assertContains(response_en, 'Firstname', status_code=200)
print (response_en.content) response_en = self.client.get('/', HTTP_ACCEPT_LANGUAGE='en')
print('END')
self.assertContains(response_en, 'You are logged in as vladimir@reiherzehe.com', status_code=200) self.assertContains(response_en, 'You are logged in as vladimir@reiherzehe.com', status_code=200)
self.assertContains(response_en, 'Firstname', status_code=200) self.assertContains(response_en, 'Firstname', status_code=200)