Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
994dde91
Commit
994dde91
authored
Jan 31, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add failing test for different capitalizations of language codes coming from the browser
parent
830ad942
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
common/djangoapps/dark_lang/tests.py
+20
-0
No files found.
common/djangoapps/dark_lang/tests.py
View file @
994dde91
"""
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment