From a841bf7d2eae03d6870a45153cc7d50279ab5b5c Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 10 Jun 2013 12:57:39 -0400 Subject: [PATCH] Use repr instead of str for getting context data via the system render function, so it works better for non-ASCII data. --- common/lib/xmodule/xmodule/tests/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/tests/__init__.py b/common/lib/xmodule/xmodule/tests/__init__.py index 6af11a3ac8..4bcf2caa6d 100644 --- a/common/lib/xmodule/xmodule/tests/__init__.py +++ b/common/lib/xmodule/xmodule/tests/__init__.py @@ -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(),