Add complete on view support to render_xblock view.
This commit is contained in:
committed by
Alex Dusenbery
parent
9ef11139d6
commit
8b1aad080a
@@ -100,7 +100,7 @@ class TestXblockUtils(SharedModuleStoreTestCase):
|
||||
block=course,
|
||||
view='baseview',
|
||||
frag=fragment,
|
||||
context=None,
|
||||
context={"wrap_xblock_data": {"custom-attribute": "custom-value"}},
|
||||
usage_id_serializer=lambda usage_id: quote_slashes(unicode(usage_id)),
|
||||
request_token=uuid.uuid1().get_hex()
|
||||
)
|
||||
@@ -109,6 +109,7 @@ class TestXblockUtils(SharedModuleStoreTestCase):
|
||||
self.assertIn('data-runtime-class="TestRuntime"', test_wrap_output.content)
|
||||
self.assertIn(data_usage_id, test_wrap_output.content)
|
||||
self.assertIn('<h1>Test!</h1>', test_wrap_output.content)
|
||||
self.assertIn('data-custom-attribute="custom-value"', test_wrap_output.content)
|
||||
self.assertEqual(test_wrap_output.resources[0].data, u'body {background-color:red;}')
|
||||
self.assertEqual(test_wrap_output.resources[1].data, 'alert("Hi!");')
|
||||
|
||||
|
||||
@@ -92,6 +92,9 @@ def wrap_xblock(
|
||||
data = {}
|
||||
data.update(extra_data)
|
||||
|
||||
if context:
|
||||
data.update(context.get('wrap_xblock_data', {}))
|
||||
|
||||
css_classes = [
|
||||
'xblock',
|
||||
'xblock-{}'.format(markupsafe.escape(view)),
|
||||
|
||||
Reference in New Issue
Block a user