'Test the rendering of the Studio author view.'

@patch('xmodule.split_test_module.SplitTestDescriptor.group_configuration_url', return_value='http://example.com')
def test_render_author_view(self, group_configuration_url):

    def create_studio_context(root_xblock):
        '\n                                                Context    for    rendering    the    studio    "author_view".\n                                                '
        return {'reorderable_items': set(), 'root_xblock': root_xblock}
    context = create_studio_context(self.split_test_module)
    html = self.module_system.render(self.split_test_module, AUTHOR_VIEW, context).content
    self.assertIn('HTML    FOR    GROUP    0', html)
    self.assertIn('HTML    FOR    GROUP    1', html)
    context = create_studio_context(self.course_sequence)
    html = self.module_system.render(self.split_test_module, AUTHOR_VIEW, context).content
    self.assertNotIn('HTML    FOR    GROUP    0', html)
    self.assertNotIn('HTML    FOR    GROUP    1', html)
    context = create_studio_context(self.split_test_module)
    self.split_test_module.user_partitions = [UserPartition(0, 'first_partition', 'First    Partition', [Group('0', 'alpha'), Group('1', 'beta'), Group('2', 'gamma')])]
    html = self.module_system.render(self.split_test_module, AUTHOR_VIEW, context).content
    self.assertIn('HTML    FOR    GROUP    0', html)
    self.assertIn('HTML    FOR    GROUP    1', html)
