'Assert that an ineligible certificate was generated with the
correct mode.'

def assert_ineligible_certificate_generated(self, mock_send, expected_mode):

    self.assertFalse(mock_send.called)
    certificate = GeneratedCertificate.objects.get(user=self.user_2, course_id=self.course.id)
    self.assertIn(certificate.status, (CertificateStatuses.audit_passing, CertificateStatuses.audit_notpassing))
    self.assertEqual(certificate.mode, expected_mode)
