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
391db6a8
Commit
391db6a8
authored
Mar 27, 2015
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Linting cleanups
parent
da296442
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
common/lib/xmodule/xmodule/tests/__init__.py
+10
-1
common/test/data/aside/policies/2012_Fall.json
+2
-2
common/test/data/xml_dag/policies/2012_Fall.json
+1
-1
No files found.
common/lib/xmodule/xmodule/tests/__init__.py
View file @
391db6a8
...
...
@@ -143,7 +143,7 @@ def get_test_system(course_id=SlashSeparatedCourseKey('org', 'course', 'run')):
render_template
=
mock_render_template
,
replace_urls
=
str
,
user
=
user
,
get_real_user
=
lambda
(
__
)
:
user
,
get_real_user
=
lambda
__
:
user
,
filestore
=
Mock
(
name
=
'get_test_system.filestore'
),
debug
=
True
,
hostname
=
"edx.org"
,
...
...
@@ -378,11 +378,17 @@ class CourseComparisonTest(BulkAssertionTest):
)
def
assertBlocksEqualByFields
(
self
,
expected_block
,
actual_block
):
"""
Compare block fields to check for equivalence.
"""
self
.
assertEqual
(
expected_block
.
fields
,
actual_block
.
fields
)
for
field
in
expected_block
.
fields
.
values
():
self
.
assertFieldEqual
(
field
,
expected_block
,
actual_block
)
def
assertFieldEqual
(
self
,
field
,
expected_block
,
actual_block
):
"""
Compare a single block field for equivalence.
"""
if
isinstance
(
field
,
(
Reference
,
ReferenceList
,
ReferenceValueDict
)):
self
.
assertReferenceRelativelyEqual
(
field
,
expected_block
,
actual_block
)
else
:
...
...
@@ -436,6 +442,9 @@ class CourseComparisonTest(BulkAssertionTest):
self
.
_assertCoursesEqual
(
expected_items
,
actual_items
,
actual_course_key
,
expect_drafts
=
True
)
def
_assertCoursesEqual
(
self
,
expected_items
,
actual_items
,
actual_course_key
,
expect_drafts
=
False
):
"""
Actual algorithm to compare courses.
"""
with
self
.
bulk_assertions
():
self
.
assertEqual
(
len
(
expected_items
),
len
(
actual_items
))
...
...
common/test/data/aside/policies/2012_Fall.json
View file @
391db6a8
...
...
@@ -3,7 +3,7 @@
"graceperiod"
:
"2 days 5 hours 59 minutes 59 seconds"
,
"start"
:
"2015-07-17T12:00"
,
"display_name"
:
"Toy Course"
,
"graded"
:
"true"
,
"graded"
:
"true"
},
"tabs"
:
[
{
"type"
:
"courseware"
},
...
...
@@ -19,5 +19,5 @@
},
"html/secret:toylab"
:
{
"display_name"
:
"Toy lab"
}
,
}
}
common/test/data/xml_dag/policies/2012_Fall.json
View file @
391db6a8
...
...
@@ -3,6 +3,6 @@
"graceperiod"
:
"2 days 5 hours 59 minutes 59 seconds"
,
"start"
:
"2015-07-17T12:00"
,
"display_name"
:
"Toy Course"
,
"graded"
:
"true"
,
"graded"
:
"true"
}
}
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