Commit 994dde91 by Calen Pennington

Add failing test for different capitalizations of language codes coming from the browser

parent 830ad942
"""
Tests of DarkLangMiddleware
"""
from unittest import expectedFailure
from django.contrib.auth.models import User
from django.http import HttpRequest
......@@ -122,6 +123,25 @@ class DarkLangMiddlewareTests(TestCase):
self.process_request(accept='rel-ter;q=1.0, rel;q=0.5')
)
@expectedFailure
def test_accept_mixed_case(self):
self.assertAcceptEquals(
'rel-TER;q=1.0, REL;q=0.5',
self.process_request(accept='rel-TER;q=1.0, REL;q=0.5')
)
DarkLangConfig(
released_languages=('REL-TER'),
changed_by=self.user,
enabled=True
).save()
self.assertAcceptEquals(
'rel-ter;q=1.0',
self.process_request(accept='rel-ter;q=1.0, rel;q=0.5')
)
def assertSessionLangEquals(self, value, request):
"""
Assert that the 'django_language' set in request.session is equal to value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment