'indexing course with different content groups assigned to each of multiple html units'

def test_different_groups_indexed_on_assigned_html_blocks(self):

    group_access_content_1 = {'group_access': {666: [1]}}
    group_access_content_2 = {'group_access': {666: [0]}}
    self.client.ajax_post(reverse_usage_url('xblock_handler', self.html_unit1.location), data={'metadata': group_access_content_1})
    self.client.ajax_post(reverse_usage_url('xblock_handler', self.html_unit2.location), data={'metadata': group_access_content_2})
    self.publish_item(self.store, self.html_unit1.location)
    self.publish_item(self.store, self.html_unit2.location)
    with patch((settings.SEARCH_ENGINE + '.index')) as mock_index:
        self.reindex_course(self.store)
        self.assertTrue(mock_index.called)
        indexed_content = self._get_index_values_from_call_args(mock_index)
        self.assertIn(self._html_group_result(self.html_unit1, [1]), indexed_content)
        self.assertIn(self._html_group_result(self.html_unit2, [0]), indexed_content)
        mock_index.reset_mock()
