'Test that cohort -> partition group links are automatically deleted
when their parent cohort is deleted.'

def test_delete_cascade(self):

    self._link_cohort_partition_group(self.first_cohort, self.partition_id, self.group1_id)
    self.assertEqual(cohorts.get_group_info_for_cohort(self.first_cohort), (self.group1_id, self.partition_id))
    self.first_cohort.delete()
    self.assertEqual(cohorts.get_group_info_for_cohort(self.first_cohort), (None, None))
    with self.assertRaises(CourseUserGroupPartitionGroup.DoesNotExist):
        CourseUserGroupPartitionGroup.objects.get(course_user_group_id=self.first_cohort.id)
