'Creates a new certificate and verifies that it was properly created.'

def create_and_verify_certificate(self, course_title_override, existing_certs, signatories):

    self.assertEqual(existing_certs, len(self.certificates_page.certificates))
    if (existing_certs == 0):
        self.certificates_page.wait_for_first_certificate_button()
        self.certificates_page.click_first_certificate_button()
    else:
        self.certificates_page.wait_for_add_certificate_button()
        self.certificates_page.click_add_certificate_button()
    certificate = self.certificates_page.certificates[existing_certs]
    certificate.course_title = course_title_override
    added_signatories = 0
    for (idx, signatory) in enumerate(signatories):
        certificate.signatories[idx].name = signatory['name']
        certificate.signatories[idx].title = signatory['title']
        certificate.signatories[idx].organization = signatory['organization']
        certificate.signatories[idx].upload_signature_image('Signature-{}.png'.format(uuid.uuid4().hex[:4]))
        added_signatories += 1
        if (len(signatories) > added_signatories):
            certificate.click_add_signatory_button()
    self.assertEqual(certificate.get_text('.action-primary'), 'Create')
    certificate.click_create_certificate_button()
    self.assertIn(course_title_override, certificate.course_title)
    return certificate
