Commit a841bf7d by Ned Batchelder

Use repr instead of str for getting context data via the system render function,…

Use repr instead of str for getting context data via the system render function, so it works better for non-ASCII data.
parent 979ee684
......@@ -33,8 +33,8 @@ def test_system():
"""
Construct a test ModuleSystem instance.
By default, the render_template() method simply returns the context it is
passed as a string. You can override this behavior by monkey patching::
By default, the render_template() method simply returns the repr of the
context it is passed. You can override this behavior by monkey patching::
system = test_system()
system.render_template = my_render_func
......@@ -46,7 +46,7 @@ def test_system():
ajax_url='courses/course_id/modx/a_location',
track_function=Mock(),
get_module=Mock(),
render_template=lambda template, context: str(context),
render_template=lambda template, context: repr(context),
replace_urls=lambda html: str(html),
user=Mock(is_staff=False),
filestore=Mock(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment