'Try to enroll and return boolean indicating result.
`course` is an instance of CourseDescriptor.
`verify` is an optional boolean parameter specifying whether we
want to verify that the student was successfully enrolled
in the course.'

def enroll(self, course, verify=False):

    resp = self.client.post(reverse('change_enrollment'), {'enrollment_action': 'enroll', 'course_id': course.id.to_deprecated_string(), 'check_access': True})
    result = (resp.status_code == 200)
    if verify:
        self.assertTrue(result)
    return result
