edx/edx-platform — pull request #2836 by andy-armstrong (2014-03-06 05:40:24+00:00)
Title: [DO NOT MERGE] First attempt to get Studio to render split_test modules

I've made a first attempt at getting Studio to render split_test modules. It gets much further now by judicious coding around the missing partitions, but it still doesn't work. The next problem is that the modules don't have their xmodule_runtime initialized, which is the same problem seen by the Acid Block Bok Choy tests. I think that the way preview.py installs the xmodule_runtimes is flawed, but I'm out of time to understand why tonight.

The error is as follows:

```
2014-03-06 00:31:02,642 WARNING 2795 [contentstore.views.preview] preview.py:199 - Unable to render student_view for SplitTestDescriptorWithMixins(, , ScopeIds(user_id=None, block_type=u'split_test', def_id=Location(u'i4x', u'AndyA', u'ST101', u'split_test', u'AB_Test', None), usage_id=Location(u'i4x', u'AndyA', u'ST101', u'split_test', u'AB_Test', None)))
Traceback (most recent call last):
File "/edx/app/edxapp/edx-platform/cms/djangoapps/contentstore/views/preview.py", line 197, in get_preview_fragment
fragment = module.render("student_view", context)
File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/core.py", line 279, in render
return self.runtime.render(self, view, context)
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1041, in render
return block.xmodule_runtime.render(to_render, view_name, context)
File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/runtime.py", line 581, in render
frag = view_fn(context)
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/split_test_module.py", line 200, in student_view
return self.studio_preview(context)
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/split_test_module.py", line 179, in studio_preview
rendered_child = child.render('student_view', context)
File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/core.py", line 279, in render
return self.runtime.render(self, view, context)
File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1036, in render
assert block.xmodule_runtime is not None
AssertionError
[06/Mar/2014 00:31:02] "GET /xblock/AndyA.ST101.2014/branch/published/block/AB_Test/container_preview HTTP/1.1" 200 460
```

@cpennington @dianakhuang @cahrens @flowerhack Let me know what you think of this, and especially if you can see a way around the problems I'm seeing. Don't worry if you want to wait until after the hackathon.