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
dff0c10b
Commit
dff0c10b
authored
Feb 12, 2013
by
Carlos Andrés Rocha
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1493 from MITx/bug/dhm/misc
Fix broken test and don't pass time units as strings but as ints.
parents
2197bd98
c904174b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
cms/djangoapps/contentstore/tests/test_course_settings.py
+1
-1
cms/djangoapps/models/settings/course_grading.py
+2
-2
No files found.
cms/djangoapps/contentstore/tests/test_course_settings.py
View file @
dff0c10b
...
...
@@ -249,7 +249,7 @@ class CourseGradingTest(CourseTestCase):
altered_grader
=
CourseGradingModel
.
update_from_json
(
test_grader
.
__dict__
)
self
.
assertDictEqual
(
test_grader
.
__dict__
,
altered_grader
.
__dict__
,
"cutoff add D"
)
test_grader
.
grace_period
=
{
'hours'
:
'4'
}
test_grader
.
grace_period
=
{
'hours'
:
4
,
'minutes'
:
5
,
'seconds'
:
0
}
altered_grader
=
CourseGradingModel
.
update_from_json
(
test_grader
.
__dict__
)
self
.
assertDictEqual
(
test_grader
.
__dict__
,
altered_grader
.
__dict__
,
"4 hour grace period"
)
...
...
cms/djangoapps/models/settings/course_grading.py
View file @
dff0c10b
...
...
@@ -235,10 +235,10 @@ class CourseGradingModel(object):
@staticmethod
def
convert_set_grace_period
(
descriptor
):
# 5 hours 59 minutes 59 seconds =>
converted to iso format
# 5 hours 59 minutes 59 seconds =>
{ hours: 5, minutes : 59, seconds : 59}
rawgrace
=
descriptor
.
metadata
.
get
(
'graceperiod'
,
None
)
if
rawgrace
:
parsedgrace
=
{
str
(
key
):
val
for
(
val
,
key
)
in
re
.
findall
(
'
\
s*(
\
d+)
\
s*(
\
w+)'
,
rawgrace
)}
parsedgrace
=
{
str
(
key
):
int
(
val
)
for
(
val
,
key
)
in
re
.
findall
(
'
\
s*(
\
d+)
\
s*(
\
w+)'
,
rawgrace
)}
return
parsedgrace
else
:
return
None
...
...
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