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
08eb8fa7
Commit
08eb8fa7
authored
May 14, 2014
by
Adam
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3706 from edx/adam/fix-non-ascii-grade-range
Adam/fix non ascii grade range
parents
ba7171b0
9b313d73
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
lms/djangoapps/courseware/tests/test_views.py
+16
-8
lms/templates/courseware/progress_graph.js
+1
-1
No files found.
lms/djangoapps/courseware/tests/test_views.py
View file @
08eb8fa7
# coding=UTF-8
"""
"""
Tests courseware views.py
Tests courseware views.py
"""
"""
...
@@ -119,14 +120,14 @@ class ViewsTestCase(TestCase):
...
@@ -119,14 +120,14 @@ class ViewsTestCase(TestCase):
# depreciated function
# depreciated function
mock_user
=
MagicMock
()
mock_user
=
MagicMock
()
mock_user
.
is_authenticated
.
return_value
=
False
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
):
def
test_get_current_child
(
self
):
self
.
assertIsNone
(
views
.
get_current_child
(
MagicMock
()))
self
.
assertIsNone
(
views
.
get_current_child
(
MagicMock
()))
mock_xmodule
=
MagicMock
()
mock_xmodule
=
MagicMock
()
mock_xmodule
.
position
=
-
1
mock_xmodule
.
position
=
-
1
mock_xmodule
.
get_display_items
.
return_value
=
[
'one'
,
'two'
]
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
=
MagicMock
()
mock_xmodule_2
.
position
=
3
mock_xmodule_2
.
position
=
3
mock_xmodule_2
.
get_display_items
.
return_value
=
[]
mock_xmodule_2
.
get_display_items
.
return_value
=
[]
...
@@ -197,13 +198,13 @@ class ViewsTestCase(TestCase):
...
@@ -197,13 +198,13 @@ class ViewsTestCase(TestCase):
chat_settings
=
views
.
chat_settings
(
mock_course
,
mock_user
)
chat_settings
=
views
.
chat_settings
(
mock_course
,
mock_user
)
# Test the proper format of all chat settings
# Test the proper format of all chat settings
self
.
assertEqual
s
(
chat_settings
[
'domain'
],
domain
)
self
.
assertEqual
(
chat_settings
[
'domain'
],
domain
)
self
.
assertEqual
s
(
chat_settings
[
'room'
],
"a-b-c_class"
)
self
.
assertEqual
(
chat_settings
[
'room'
],
"a-b-c_class"
)
self
.
assertEqual
s
(
chat_settings
[
'username'
],
"johndoe@
%
s"
%
domain
)
self
.
assertEqual
(
chat_settings
[
'username'
],
"johndoe@
%
s"
%
domain
)
# TODO: this needs to be changed once we figure out how to
# TODO: this needs to be changed once we figure out how to
# generate/store a real password.
# 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
):
def
test_course_mktg_about_coming_soon
(
self
):
# we should not be able to find this course
# we should not be able to find this course
...
@@ -440,7 +441,10 @@ class ProgressPageTests(ModuleStoreTestCase):
...
@@ -440,7 +441,10 @@ class ProgressPageTests(ModuleStoreTestCase):
MakoMiddleware
()
.
process_request
(
self
.
request
)
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
.
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
self
.
chapter
=
ItemFactory
(
category
=
'chapter'
,
parent_location
=
self
.
course
.
location
)
# pylint: disable=no-member
...
@@ -451,5 +455,9 @@ class ProgressPageTests(ModuleStoreTestCase):
...
@@ -451,5 +455,9 @@ class ProgressPageTests(ModuleStoreTestCase):
ItemFactory
(
category
=
'acid'
,
parent_location
=
self
.
vertical
.
location
)
ItemFactory
(
category
=
'acid'
,
parent_location
=
self
.
vertical
.
location
)
resp
=
views
.
progress
(
self
.
request
,
self
.
course
.
id
)
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
)
lms/templates/courseware/progress_graph.js
View file @
08eb8fa7
...
@@ -103,7 +103,7 @@ $(function () {
...
@@ -103,7 +103,7 @@ $(function () {
descending_grades
=
sorted
(
grade_cutoffs
,
key
=
lambda
x
:
grade_cutoffs
[
x
],
reverse
=
True
)
descending_grades
=
sorted
(
grade_cutoffs
,
key
=
lambda
x
:
grade_cutoffs
[
x
],
reverse
=
True
)
for
grade
in
descending_grades
:
for
grade
in
descending_grades
:
percent
=
grade_cutoffs
[
grade
]
percent
=
grade_cutoffs
[
grade
]
grade_cutoff_ticks
.
append
(
[
percent
,
"{0} {1:.0%}"
.
format
(
grade
,
percent
)
]
)
grade_cutoff_ticks
.
append
(
[
percent
,
u
"{0} {1:.0%}"
.
format
(
grade
,
percent
)
]
)
else
:
else
:
grade_cutoff_ticks
=
[
]
grade_cutoff_ticks
=
[
]
%>
%>
...
...
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