'Dry method to mark certificate as invalid.'

def _invalidate_certificate(self, certificate):

    CertificateInvalidationFactory.create(generated_certificate=certificate, invalidated_by=self.support, active=True)
    certificate.invalidate()
    self.assertFalse(certificate.is_valid())
