def _collect_certificate_data(self, enterprise_enrollment):
if self.certificates_api is None:<EOL><INDENT>self.certificates_api = CertificatesApiClient(self.user)<EOL><DEDENT>course_id = enterprise_enrollment.course_id<EOL>username = enterprise_enrollment.enterprise_customer_user.user.username<EOL>try:<EOL><INDENT>certificate = self.certificates_api.get_course_certificate(course_id, username)<EOL>completed_date = certificate.get('<STR_LIT>')<EOL>if completed_date:<EOL><INDENT>completed_date = parse_datetime(completed_date)<EOL><DEDENT>else:<EOL><INDENT>completed_date = timezone.now()<EOL><DEDENT>is_passing = certificate.get('<STR_LIT>')<EOL>grade = self.grade_passing if is_passing else self.grade_failing<EOL><DEDENT>except HttpNotFoundError:<EOL><INDENT>completed_date = None<EOL>grade = self.grade_incomplete<EOL>is_passing = False<EOL><DEDENT>return completed_date, grade, is_passing<EOL>
Collect the learner completion data from the course certificate.

Used for Instructor-paced courses.

If no certificate is found, then returns the completed_date = None, grade = In Progress, on the idea that a
certificate will eventually be generated.

Args:
    enterprise_enrollment (EnterpriseCourseEnrollment): the enterprise enrollment record for which we need to
    collect completion/grade data

Returns:
    completed_date: Date the course was completed, this is None if course has not been completed.
    grade: Current grade in the course.
    is_passing: Boolean indicating if the grade is a passing grade or not.