'Dry method to mark certificate as invalid. And assert the response.'

def assert_invalidate_certificate(self, certificate):

    CertificateInvalidationFactory.create(generated_certificate=certificate, invalidated_by=self.user)
    certificate.invalidate()
    resp = self._get_progress_page()
    self.assertNotContains(resp, u'Request    Certificate')
    self.assertContains(resp, u'Your    certificate    has    been    invalidated')
    self.assertContains(resp, u'Please    contact    your    course    team    if    you    have    any    questions.')
    self.assertNotContains(resp, u'View    Your    Certificate')
    self.assertNotContains(resp, u'Download    Your    Certificate')
