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
2b95b0ba
Commit
2b95b0ba
authored
May 13, 2014
by
Adam Palay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add failing tests for non-ascii characters in grade cutoffs on progress page (LMS-2687)
parent
9407102b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
lms/djangoapps/courseware/tests/test_views.py
+16
-8
No files found.
lms/djangoapps/courseware/tests/test_views.py
View file @
2b95b0ba
# coding=UTF-8
"""
Tests courseware views.py
"""
...
...
@@ -119,14 +120,14 @@ class ViewsTestCase(TestCase):
# depreciated function
mock_user
=
MagicMock
()
mock_user
.
is_authenticated
.
return_value
=
False
self
.
assertEqual
s
(
views
.
user_groups
(
mock_user
),
[])
self
.
assertEqual
(
views
.
user_groups
(
mock_user
),
[])
def
test_get_current_child
(
self
):
self
.
assertIsNone
(
views
.
get_current_child
(
MagicMock
()))
mock_xmodule
=
MagicMock
()
mock_xmodule
.
position
=
-
1
mock_xmodule
.
get_display_items
.
return_value
=
[
'one'
,
'two'
]
self
.
assertEqual
s
(
views
.
get_current_child
(
mock_xmodule
),
'one'
)
self
.
assertEqual
(
views
.
get_current_child
(
mock_xmodule
),
'one'
)
mock_xmodule_2
=
MagicMock
()
mock_xmodule_2
.
position
=
3
mock_xmodule_2
.
get_display_items
.
return_value
=
[]
...
...
@@ -197,13 +198,13 @@ class ViewsTestCase(TestCase):
chat_settings
=
views
.
chat_settings
(
mock_course
,
mock_user
)
# Test the proper format of all chat settings
self
.
assertEqual
s
(
chat_settings
[
'domain'
],
domain
)
self
.
assertEqual
s
(
chat_settings
[
'room'
],
"a-b-c_class"
)
self
.
assertEqual
s
(
chat_settings
[
'username'
],
"johndoe@
%
s"
%
domain
)
self
.
assertEqual
(
chat_settings
[
'domain'
],
domain
)
self
.
assertEqual
(
chat_settings
[
'room'
],
"a-b-c_class"
)
self
.
assertEqual
(
chat_settings
[
'username'
],
"johndoe@
%
s"
%
domain
)
# TODO: this needs to be changed once we figure out how to
# generate/store a real password.
self
.
assertEqual
s
(
chat_settings
[
'password'
],
"johndoe@
%
s"
%
domain
)
self
.
assertEqual
(
chat_settings
[
'password'
],
"johndoe@
%
s"
%
domain
)
def
test_course_mktg_about_coming_soon
(
self
):
# we should not be able to find this course
...
...
@@ -440,7 +441,10 @@ class ProgressPageTests(ModuleStoreTestCase):
MakoMiddleware
()
.
process_request
(
self
.
request
)
course
=
CourseFactory
(
start
=
datetime
(
2013
,
9
,
16
,
7
,
17
,
28
))
course
=
CourseFactory
(
start
=
datetime
(
2013
,
9
,
16
,
7
,
17
,
28
),
grade_cutoffs
=
{
u'çü†øƒƒ'
:
0.75
,
'Pass'
:
0.5
},
)
self
.
course
=
modulestore
()
.
get_instance
(
course
.
id
,
course
.
location
)
# pylint: disable=no-member
self
.
chapter
=
ItemFactory
(
category
=
'chapter'
,
parent_location
=
self
.
course
.
location
)
# pylint: disable=no-member
...
...
@@ -451,5 +455,9 @@ class ProgressPageTests(ModuleStoreTestCase):
ItemFactory
(
category
=
'acid'
,
parent_location
=
self
.
vertical
.
location
)
resp
=
views
.
progress
(
self
.
request
,
self
.
course
.
id
)
self
.
assertEquals
(
resp
.
status_code
,
200
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
def
test_non_asci_grade_cutoffs
(
self
):
resp
=
views
.
progress
(
self
.
request
,
self
.
course
.
id
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
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