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
58f1ce0a
Commit
58f1ce0a
authored
Apr 10, 2017
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add language tests for student_account (logistration)
[LEARNER-243]
parent
e2c81835
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
lms/djangoapps/student_account/test/test_views.py
+21
-0
No files found.
lms/djangoapps/student_account/test/test_views.py
View file @
58f1ce0a
...
@@ -35,6 +35,7 @@ from commerce.models import CommerceConfiguration
...
@@ -35,6 +35,7 @@ from commerce.models import CommerceConfiguration
from
commerce.tests
import
factories
from
commerce.tests
import
factories
from
commerce.tests.mocks
import
mock_get_orders
from
commerce.tests.mocks
import
mock_get_orders
from
course_modes.models
import
CourseMode
from
course_modes.models
import
CourseMode
from
edxmako.shortcuts
import
render_to_response
from
openedx.core.djangoapps.oauth_dispatch.tests
import
factories
as
dot_factories
from
openedx.core.djangoapps.oauth_dispatch.tests
import
factories
as
dot_factories
from
openedx.core.djangoapps.programs.tests.mixins
import
ProgramsApiConfigMixin
from
openedx.core.djangoapps.programs.tests.mixins
import
ProgramsApiConfigMixin
from
openedx.core.djangoapps.user_api.accounts.api
import
activate_account
,
create_account
from
openedx.core.djangoapps.user_api.accounts.api
import
activate_account
,
create_account
...
@@ -521,6 +522,26 @@ class StudentAccountLoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMi
...
@@ -521,6 +522,26 @@ class StudentAccountLoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMi
'next'
:
'/account/finish_auth?{}'
.
format
(
urlencode
(
params
))
'next'
:
'/account/finish_auth?{}'
.
format
(
urlencode
(
params
))
})
})
def
test_english_by_default
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'signin_user'
),
[],
HTTP_ACCEPT
=
"text/html"
)
self
.
assertEqual
(
response
[
'Content-Language'
],
'en'
)
def
test_unsupported_language
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'signin_user'
),
[],
HTTP_ACCEPT
=
"text/html"
,
HTTP_ACCEPT_LANGUAGE
=
"ts-zx"
)
self
.
assertEqual
(
response
[
'Content-Language'
],
'en'
)
def
test_browser_language
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'signin_user'
),
[],
HTTP_ACCEPT
=
"text/html"
,
HTTP_ACCEPT_LANGUAGE
=
"es"
)
self
.
assertEqual
(
response
[
'Content-Language'
],
'es-419'
)
def
test_browser_language_dialent
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'signin_user'
),
[],
HTTP_ACCEPT
=
"text/html"
,
HTTP_ACCEPT_LANGUAGE
=
"es-es"
)
self
.
assertEqual
(
response
[
'Content-Language'
],
'es-es'
)
class
AccountSettingsViewTest
(
ThirdPartyAuthTestMixin
,
TestCase
,
ProgramsApiConfigMixin
):
class
AccountSettingsViewTest
(
ThirdPartyAuthTestMixin
,
TestCase
,
ProgramsApiConfigMixin
):
""" Tests for the account settings view. """
""" Tests for the account settings view. """
...
...
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