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
48686793
Commit
48686793
authored
Feb 14, 2014
by
thedeadparrot
Committed by
Julia Hansbrough
Feb 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up tests.
parent
cb209fa0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
common/djangoapps/student/views.py
+0
-1
common/djangoapps/user_api/models.py
+1
-0
common/djangoapps/user_api/tests/test_middleware.py
+1
-2
common/test/acceptance/tests/test_lms.py
+10
-9
No files found.
common/djangoapps/student/views.py
View file @
48686793
...
...
@@ -27,7 +27,6 @@ from django.http import (HttpResponse, HttpResponseBadRequest, HttpResponseForbi
from
django.shortcuts
import
redirect
from
django_future.csrf
import
ensure_csrf_cookie
from
django.utils.http
import
cookie_date
,
base36_to_int
from
django.utils
import
translation
from
django.utils.translation
import
ugettext
as
_
from
django.views.decorators.http
import
require_POST
,
require_GET
...
...
common/djangoapps/user_api/models.py
View file @
48686793
from
django.contrib.auth.models
import
User
from
django.db
import
models
# this is the UserPreference key for the user's preferred language
LANGUAGE_KEY
=
'pref-lang'
...
...
common/djangoapps/user_api/tests/test_middleware.py
View file @
48686793
...
...
@@ -14,10 +14,9 @@ class TestUserPreferenceMiddleware(TestCase):
def
setUp
(
self
):
self
.
middleware
=
UserPreferenceMiddleware
()
self
.
request_factory
=
RequestFactory
()
self
.
session_middleware
=
SessionMiddleware
()
self
.
user
=
UserFactory
.
create
()
self
.
request
=
self
.
request_factory
.
get
(
'/somewhere'
)
self
.
request
=
RequestFactory
()
.
get
(
'/somewhere'
)
self
.
request
.
user
=
self
.
user
self
.
session_middleware
.
process_request
(
self
.
request
)
...
...
common/test/acceptance/tests/test_lms.py
View file @
48686793
...
...
@@ -82,16 +82,18 @@ class LanguageTest(UniqueCourseTest):
super
(
LanguageTest
,
self
)
.
setUp
()
self
.
dashboard_page
=
DashboardPage
(
self
.
browser
)
self
.
test_new_lang
=
'eo'
# This string is unicode for "ÇÜRRÉNT ÇØÜRSÉS", which should appear in our Dummy Esperanto page
self
.
current_courses_text
=
u"
\xc7\xdc
RR
\xc9
NT
\xc7\xd8\xdc
RS
\xc9
S"
def
test_change_lang
(
self
):
AutoAuthPage
(
self
.
browser
,
course_id
=
self
.
course_id
)
.
visit
()
self
.
dashboard_page
.
visit
()
# Change language to Dummy Esperanto
self
.
dashboard_page
.
change_language
(
"eo"
)
self
.
dashboard_page
.
change_language
(
self
.
test_new_lang
)
# This string is unicode for "ÇÜRRÉNT ÇØÜRSÉS", which should appear in our Dummy Esperanto page
seektext
=
u"
\xc7\xdc
RR
\xc9
NT
\xc7\xd8\xdc
RS
\xc9
S"
self
.
browser
.
is_text_present
(
seektext
)
self
.
assertTrue
(
self
.
browser
.
is_text_present
(
seektext
))
self
.
browser
.
is_text_present
(
self
.
current_courses_text
)
self
.
assertTrue
(
self
.
browser
.
is_text_present
(
self
.
current_courses_text
))
def
test_language_persists
(
self
):
auto_auth_page
=
AutoAuthPage
(
self
.
browser
,
course_id
=
self
.
course_id
)
...
...
@@ -99,7 +101,7 @@ class LanguageTest(UniqueCourseTest):
self
.
dashboard_page
.
visit
()
# Change language to Dummy Esperanto
self
.
dashboard_page
.
change_language
(
"eo"
)
self
.
dashboard_page
.
change_language
(
self
.
test_new_lang
)
# destroy session
self
.
browser
.
_cookie_manager
.
delete
()
...
...
@@ -109,9 +111,8 @@ class LanguageTest(UniqueCourseTest):
self
.
dashboard_page
.
visit
()
# This string is unicode for "ÇÜRRÉNT ÇØÜRSÉS", which should appear in our Dummy Esperanto page
seektext
=
u"
\xc7\xdc
RR
\xc9
NT
\xc7\xd8\xdc
RS
\xc9
S"
self
.
browser
.
is_text_present
(
seektext
)
self
.
assertTrue
(
self
.
browser
.
is_text_present
(
seektext
))
self
.
browser
.
is_text_present
(
self
.
current_courses_text
)
self
.
assertTrue
(
self
.
browser
.
is_text_present
(
self
.
current_courses_text
))
class
HighLevelTabTest
(
UniqueCourseTest
):
...
...
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