'If the certificate is marked as invalid, regenerate the certificate
and verify the invalidate entry is deactivated.'

def test_regenerate_cert_with_invalidated_record(self):

    self._invalidate_certificate(self.cert)
    self.assertInvalidatedCertExists()
    self.assertGeneratedCertExists(user=self.student, status=CertificateStatuses.unavailable)
    response = self._regenerate(course_key=self.CERT_COURSE_KEY, username=self.STUDENT_USERNAME)
    self.assertEqual(response.status_code, 200)
    self.assertInvalidatedCertDoesNotExist()
    self.assertGeneratedCertExists(user=self.student, status=CertificateStatuses.notpassing)
