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
c08831b4
Commit
c08831b4
authored
Jun 03, 2014
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3974 from edx/zoldak/fix-translation-tags
Fix some translation tags
parents
8ab61567
ac17e809
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
common/djangoapps/student/views.py
+1
-1
lms/djangoapps/dashboard/tests/test_sysadmin.py
+12
-12
lms/djangoapps/shoppingcart/tests/test_views.py
+2
-2
No files found.
common/djangoapps/student/views.py
View file @
c08831b4
...
...
@@ -795,7 +795,7 @@ def login_user(request, error=""): # pylint: disable-msg=too-many-statements,un
"success"
:
False
,
"value"
:
_
(
'Your password has expired due to password policy on this account. You must '
'reset your password before you can log in again. Please click the '
'Forgot Password" link on this page to reset your password before logging in again.'
),
'
"
Forgot Password" link on this page to reset your password before logging in again.'
),
})
# TODO: this should be status code 403 # pylint: disable=fixme
# if the user doesn't exist, we want to set the username to an invalid
...
...
lms/djangoapps/dashboard/tests/test_sysadmin.py
View file @
c08831b4
...
...
@@ -164,13 +164,13 @@ class TestSysadmin(SysadminBaseTestCase):
{
'action'
:
'create_user'
,
'student_fullname'
:
'blah'
,
'student_password'
:
'foozor'
,
})
self
.
assertIn
(
_
(
'Must provide username'
)
,
response
.
content
.
decode
(
'utf-8'
))
self
.
assertIn
(
'Must provide username'
,
response
.
content
.
decode
(
'utf-8'
))
# no full name
response
=
self
.
client
.
post
(
reverse
(
'sysadmin'
),
{
'action'
:
'create_user'
,
'student_uname'
:
'test_cuser+sysadmin@edx.org'
,
'student_password'
:
'foozor'
,
})
self
.
assertIn
(
_
(
'Must provide full name'
)
,
response
.
content
.
decode
(
'utf-8'
))
self
.
assertIn
(
'Must provide full name'
,
response
.
content
.
decode
(
'utf-8'
))
# Test create valid user
self
.
client
.
post
(
reverse
(
'sysadmin'
),
...
...
@@ -195,20 +195,20 @@ class TestSysadmin(SysadminBaseTestCase):
# Try no username
response
=
self
.
client
.
post
(
reverse
(
'sysadmin'
),
{
'action'
:
'del_user'
,
})
self
.
assertIn
(
_
(
'Must provide username'
)
,
response
.
content
.
decode
(
'utf-8'
))
self
.
assertIn
(
'Must provide username'
,
response
.
content
.
decode
(
'utf-8'
))
# Try bad usernames
response
=
self
.
client
.
post
(
reverse
(
'sysadmin'
),
{
'action'
:
'del_user'
,
'student_uname'
:
'flabbergast@example.com'
,
'student_fullname'
:
'enigma jones'
,
})
self
.
assertIn
(
_
(
'Cannot find user with email address'
)
,
response
.
content
.
decode
(
'utf-8'
))
self
.
assertIn
(
'Cannot find user with email address'
,
response
.
content
.
decode
(
'utf-8'
))
response
=
self
.
client
.
post
(
reverse
(
'sysadmin'
),
{
'action'
:
'del_user'
,
'student_uname'
:
'flabbergast'
,
'student_fullname'
:
'enigma jones'
,
})
self
.
assertIn
(
_
(
'Cannot find user with username'
)
,
response
.
content
.
decode
(
'utf-8'
))
self
.
assertIn
(
'Cannot find user with username'
,
response
.
content
.
decode
(
'utf-8'
))
self
.
client
.
post
(
reverse
(
'sysadmin'
),
{
'action'
:
'del_user'
,
...
...
@@ -271,9 +271,9 @@ class TestSysadmin(SysadminBaseTestCase):
response
=
self
.
client
.
post
(
reverse
(
'sysadmin'
),
{
'action'
:
'repair_eamap'
,
})
self
.
assertIn
(
'{0} test0'
.
format
(
_
(
'Failed in authenticating'
)
),
self
.
assertIn
(
'{0} test0'
.
format
(
'Failed in authenticating'
),
response
.
content
)
self
.
assertIn
(
_
(
'fixed password'
)
,
response
.
content
.
decode
(
'utf-8'
))
self
.
assertIn
(
'fixed password'
,
response
.
content
.
decode
(
'utf-8'
))
self
.
assertTrue
(
self
.
client
.
login
(
username
=
'test0'
,
password
=
eamap
.
internal_password
))
...
...
@@ -282,7 +282,7 @@ class TestSysadmin(SysadminBaseTestCase):
self
.
_setstaff_login
()
response
=
self
.
client
.
post
(
reverse
(
'sysadmin'
),
{
'action'
:
'repair_eamap'
,
})
self
.
assertIn
(
_
(
'All ok!'
)
,
response
.
content
.
decode
(
'utf-8'
))
self
.
assertIn
(
'All ok!'
,
response
.
content
.
decode
(
'utf-8'
))
def
test_xml_course_add_delete
(
self
):
"""add and delete course from xml module store"""
...
...
@@ -299,7 +299,7 @@ class TestSysadmin(SysadminBaseTestCase):
response
=
self
.
client
.
post
(
reverse
(
'sysadmin_courses'
),
{
'repo_location'
:
'http://example.com/not_real.git'
,
'action'
:
'add_course'
,
})
self
.
assertIn
(
_
(
'Unable to clone or pull repository'
)
,
self
.
assertIn
(
'Unable to clone or pull repository'
,
response
.
content
.
decode
(
'utf-8'
))
# Create git loaded course
response
=
self
.
_add_edx4edx
()
...
...
@@ -333,7 +333,7 @@ class TestSysadmin(SysadminBaseTestCase):
response
=
self
.
client
.
post
(
reverse
(
'sysadmin_courses'
),
{
'course_id'
:
'foobar/foo/blah'
,
'action'
:
'del_course'
,
})
self
.
assertIn
(
_
(
'Error - cannot get course with ID'
)
,
self
.
assertIn
(
'Error - cannot get course with ID'
,
response
.
content
.
decode
(
'utf-8'
))
@override_settings
(
GIT_IMPORT_WITH_XMLMODULESTORE
=
False
)
...
...
@@ -375,8 +375,8 @@ class TestSysadmin(SysadminBaseTestCase):
{
'action'
:
'get_staff_csv'
,
})
self
.
assertIn
(
'attachment'
,
response
[
'Content-Disposition'
])
self
.
assertEqual
(
'text/csv'
,
response
[
'Content-Type'
])
columns
=
[
_
(
'course_id'
),
_
(
'role'
),
_
(
'username'
)
,
_
(
'email'
),
_
(
'full_name'
)
,
]
columns
=
[
'course_id'
,
'role'
,
'username'
,
'email'
,
'full_name'
,
]
self
.
assertIn
(
','
.
join
(
'"'
+
c
+
'"'
for
c
in
columns
),
response
.
content
)
...
...
lms/djangoapps/shoppingcart/tests/test_views.py
View file @
c08831b4
...
...
@@ -70,14 +70,14 @@ class ShoppingCartViewsTests(ModuleStoreTestCase):
self
.
login_user
()
resp
=
self
.
client
.
post
(
reverse
(
'shoppingcart.views.add_course_to_cart'
,
args
=
[
self
.
course_key
.
to_deprecated_string
()]))
self
.
assertEqual
(
resp
.
status_code
,
400
)
self
.
assertIn
(
_
(
'The course {0} is already in your cart.'
.
format
(
self
.
course_key
.
to_deprecated_string
()
)),
resp
.
content
)
self
.
assertIn
(
'The course {0} is already in your cart.'
.
format
(
self
.
course_key
.
to_deprecated_string
(
)),
resp
.
content
)
def
test_add_course_to_cart_already_registered
(
self
):
CourseEnrollment
.
enroll
(
self
.
user
,
self
.
course_key
)
self
.
login_user
()
resp
=
self
.
client
.
post
(
reverse
(
'shoppingcart.views.add_course_to_cart'
,
args
=
[
self
.
course_key
.
to_deprecated_string
()]))
self
.
assertEqual
(
resp
.
status_code
,
400
)
self
.
assertIn
(
_
(
'You are already registered in course {0}.'
.
format
(
self
.
course_key
.
to_deprecated_string
()
)),
resp
.
content
)
self
.
assertIn
(
'You are already registered in course {0}.'
.
format
(
self
.
course_key
.
to_deprecated_string
(
)),
resp
.
content
)
def
test_add_nonexistent_course_to_cart
(
self
):
self
.
login_user
()
...
...
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