'Delete content group and check user partitions.'

def test_can_delete_content_group(self):

    self._add_user_partitions(count=1, scheme_id='cohort')
    self.save_course()
    details_url_with_group_id = (self._url(cid=0) + '/1')
    response = self.client.delete(details_url_with_group_id, content_type='application/json', HTTP_ACCEPT='application/json', HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    self.assertEqual(response.status_code, 204)
    self.reload_course()
    user_partititons = self.course.user_partitions
    self.assertEqual(len(user_partititons), 1)
    self.assertEqual(user_partititons[0].name, 'Name    0')
    self.assertEqual(len(user_partititons[0].groups), 2)
    self.assertEqual(user_partititons[0].groups[1].name, 'Group    C')
