'Test that course deletion removes users from \'instructor\' and \'staff\' groups of this course
of all format e.g, \'instructor_edX/Course/Run\', \'instructor_edX.Course.Run\', \'instructor_Course\''

def test_course_access_groups_on_delete(self):

    test_course_data = self.assert_created_course(number_suffix=uuid4().hex)
    course_id = _get_course_id(self.store, test_course_data)
    instructor_role = CourseInstructorRole(course_id)
    auth.add_users(self.user, instructor_role, self.user)
    self.assertGreater(len(instructor_role.users_with_role()), 0)
    delete_course(course_id, self.user.id)
    self.user = User.objects.get_by_natural_key(self.user.natural_key()[0])
    self.assertFalse(instructor_role.has_user(self.user))
    self.assertEqual(len(instructor_role.users_with_role()), 0)
