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
094bf7e5
Commit
094bf7e5
authored
Jul 31, 2013
by
Calen Pennington
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #536 from edx/cale/make-render_template-mocking-clearer
Make render_template mocking clearer
parents
2ac27550
b64aa813
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py
+3
-3
lms/djangoapps/courseware/tests/__init__.py
+1
-1
lms/djangoapps/courseware/tests/test_videoalpha_xml.py
+1
-1
No files found.
common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py
View file @
094bf7e5
...
...
@@ -66,7 +66,7 @@ class TestXBlockWrapper(object):
@property
def
leaf_module_runtime
(
self
):
runtime
=
Mock
()
runtime
.
render_template
=
lambda
*
args
,
**
kwargs
:
u
nicode
((
args
,
kwargs
)
)
runtime
.
render_template
=
lambda
*
args
,
**
kwargs
:
u
'{!r}, {!r}'
.
format
(
args
,
kwargs
)
runtime
.
anonymous_student_id
=
'dummy_anonymous_student_id'
runtime
.
open_ended_grading_interface
=
{}
runtime
.
seed
=
5
...
...
@@ -78,7 +78,7 @@ class TestXBlockWrapper(object):
@property
def
leaf_descriptor_runtime
(
self
):
runtime
=
Mock
()
runtime
.
render_template
=
lambda
*
args
,
**
kwargs
:
u
nicode
((
args
,
kwargs
)
)
runtime
.
render_template
=
lambda
*
args
,
**
kwargs
:
u
'{!r}, {!r}'
.
format
(
args
,
kwargs
)
return
runtime
def
leaf_descriptor
(
self
,
descriptor_cls
):
...
...
@@ -102,7 +102,7 @@ class TestXBlockWrapper(object):
@property
def
container_descriptor_runtime
(
self
):
runtime
=
Mock
()
runtime
.
render_template
=
lambda
*
args
,
**
kwargs
:
u
nicode
((
args
,
kwargs
)
)
runtime
.
render_template
=
lambda
*
args
,
**
kwargs
:
u
'{!r}, {!r}'
.
format
(
args
,
kwargs
)
return
runtime
def
container_descriptor
(
self
,
descriptor_cls
):
...
...
lms/djangoapps/courseware/tests/__init__.py
View file @
094bf7e5
...
...
@@ -80,7 +80,7 @@ class BaseTestXmodule(ModuleStoreTestCase):
self
.
runtime
=
get_test_system
()
# Allow us to assert that the template was called in the same way from
# different code paths while maintaining the type returned by render_template
self
.
runtime
.
render_template
=
lambda
template
,
context
:
u
nicode
((
template
,
sorted
(
context
.
items
()
)))
self
.
runtime
.
render_template
=
lambda
template
,
context
:
u
'{!r}, {!r}'
.
format
(
template
,
sorted
(
context
.
items
(
)))
model_data
=
{
'location'
:
self
.
item_descriptor
.
location
}
model_data
.
update
(
self
.
MODEL_DATA
)
...
...
lms/djangoapps/courseware/tests/test_videoalpha_xml.py
View file @
094bf7e5
...
...
@@ -104,7 +104,7 @@ class VideoAlphaModuleUnitTest(unittest.TestCase):
def
test_videoalpha_constructor
(
self
):
"""Make sure that all parameters extracted correclty from xml"""
module
=
VideoAlphaFactory
.
create
()
module
.
runtime
.
render_template
=
lambda
template
,
context
:
u
nicode
((
template
,
sorted
(
context
.
items
()
)))
module
.
runtime
.
render_template
=
lambda
template
,
context
:
u
'{!r}, {!r}'
.
format
(
template
,
sorted
(
context
.
items
(
)))
fragment
=
module
.
runtime
.
render
(
module
,
None
,
'student_view'
)
expected_context
=
{
...
...
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