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
c904174b
Commit
c904174b
authored
Feb 12, 2013
by
Don Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken test and don't pass time units as strings but as ints.
parent
76d675ba
Hide 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 @
c904174b
...
...
@@ -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 @
c904174b
...
...
@@ -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