Example #1
0
    def test_serialize_envelope_with_role(self):
        role = Role(
            email='*****@*****.**',
            name='My Name',
            roleName='Role 1')
        envelope = Envelope(
            emailBlurb='This is the email body',
            emailSubject='This is the email subject',
            templateId='1111-2222-3333-4444',
            templateRoles=[role],
            status=ENVELOPE_STATUS_DRAFT)
        self.assertEqual(envelope.to_dict(), {
            'emailBlurb': 'This is the email body',
            'emailSubject': 'This is the email subject',
            'templateId': '1111-2222-3333-4444',
            'templateRoles': [
                role.to_dict()
            ],
            'status': ENVELOPE_STATUS_DRAFT,
        })

        notification = EventNotification(url='fake')
        envelope.eventNotification = notification
        self.assertEqual(
            envelope.to_dict()['eventNotification'], notification.to_dict())
Example #2
0
    def test_serialize_envelope_with_signer(self):
        tab = SignHereTab(
            documentId=1,
            pageNumber=1,
            xPosition=100,
            yPosition=100)
        signer = Signer(
            email='*****@*****.**',
            name='My Name',
            recipientId=1,
            tabs=[tab])
        document = Document(
            documentId=2,
            name='document.pdf')
        envelope = Envelope(
            documents=[document],
            emailBlurb='This is the email body',
            emailSubject='This is the email subject',
            recipients=[signer],
            status=ENVELOPE_STATUS_DRAFT)
        self.assertEqual(envelope.to_dict(), {
            'documents': [document.to_dict()],
            'emailBlurb': 'This is the email body',
            'emailSubject': 'This is the email subject',
            'recipients': {
                'signers': [signer.to_dict()],
            },
            'status': ENVELOPE_STATUS_DRAFT,
        })

        notification = EventNotification(url='fake')
        envelope.eventNotification = notification
        self.assertEqual(
            envelope.to_dict()['eventNotification'], notification.to_dict())
Example #3
0
    def test_serialize_envelope_with_signer(self):
        tab = SignHereTab(documentId=1,
                          pageNumber=1,
                          xPosition=100,
                          yPosition=100)
        signer = Signer(email='*****@*****.**',
                        name='My Name',
                        recipientId=1,
                        tabs=[tab])
        document = Document(documentId=2, name='document.pdf')
        envelope = Envelope(documents=[document],
                            emailBlurb='This is the email body',
                            emailSubject='This is the email subject',
                            recipients=[signer],
                            status=ENVELOPE_STATUS_DRAFT)
        self.assertEqual(
            envelope.to_dict(), {
                'documents': [document.to_dict()],
                'emailBlurb': 'This is the email body',
                'emailSubject': 'This is the email subject',
                'recipients': {
                    'signers': [signer.to_dict()],
                },
                'status': ENVELOPE_STATUS_DRAFT,
            })

        notification = EventNotification(url='fake')
        envelope.eventNotification = notification
        self.assertEqual(envelope.to_dict()['eventNotification'],
                         notification.to_dict())
Example #4
0
    def test_serialize_envelope_with_role(self):
        role = Role(email='*****@*****.**',
                    name='My Name',
                    roleName='Role 1')
        envelope = Envelope(emailBlurb='This is the email body',
                            emailSubject='This is the email subject',
                            templateId='1111-2222-3333-4444',
                            templateRoles=[role],
                            status=ENVELOPE_STATUS_DRAFT)
        self.assertEqual(
            envelope.to_dict(), {
                'emailBlurb': 'This is the email body',
                'emailSubject': 'This is the email subject',
                'templateId': '1111-2222-3333-4444',
                'templateRoles': [role.to_dict()],
                'status': ENVELOPE_STATUS_DRAFT,
            })

        notification = EventNotification(url='fake')
        envelope.eventNotification = notification
        self.assertEqual(envelope.to_dict()['eventNotification'],
                         notification.to_dict())
Example #5
0
 def test_serialize_event_notification(self):
     event_notification = EventNotification(
         url='http://example.com',
     )
     self.assertEqual(event_notification.to_dict(), {
         'url': 'http://example.com',
         'loggingEnabled': True,
         'requireAcknowledgement': True,
         'useSoapInterface': False,
         'soapNameSpace': '',
         'includeCertificateWithSoap': False,
         'signMessageWithX509Cert': False,
         'includeDocuments': False,
         'includeTimeZone': True,
         'includeSenderAccountAsCustomField': True,
         'envelopeEvents': [
             {
                 'envelopeEventStatusCode': ENVELOPE_STATUS_SENT,
                 'includeDocuments': False,
             },
             {
                 'envelopeEventStatusCode': 'Delivered',
                 'includeDocuments': False,
             },
             {
                 'envelopeEventStatusCode': 'Completed',
                 'includeDocuments': False,
             },
             {
                 'envelopeEventStatusCode': 'Declined',
                 'includeDocuments': False,
             },
             {
                 'envelopeEventStatusCode': 'Voided',
                 'includeDocuments': False,
             },
         ],
         'recipientEvents': [
             {
                 'recipientEventStatusCode': 'AuthenticationFailed',
                 'includeDocuments': False,
             },
             {
                 'recipientEventStatusCode': 'AutoResponded',
                 'includeDocuments': False,
             },
             {
                 'recipientEventStatusCode': 'Completed',
                 'includeDocuments': False,
             },
             {
                 'recipientEventStatusCode': 'Declined',
                 'includeDocuments': False,
             },
             {
                 'recipientEventStatusCode': 'Delivered',
                 'includeDocuments': False,
             },
             {
                 'recipientEventStatusCode': RECIPIENT_STATUS_SENT,
                 'includeDocuments': False,
             },
         ],
     })
Example #6
0
 def test_serialize_event_notification(self):
     event_notification = EventNotification(url='http://example.com', )
     self.assertEqual(
         event_notification.to_dict(), {
             'url':
             'http://example.com',
             'loggingEnabled':
             True,
             'requireAcknowledgement':
             True,
             'useSoapInterface':
             False,
             'soapNameSpace':
             '',
             'includeCertificateWithSoap':
             False,
             'signMessageWithX509Cert':
             False,
             'includeDocuments':
             False,
             'includeTimeZone':
             True,
             'includeSenderAccountAsCustomField':
             True,
             'envelopeEvents': [
                 {
                     'envelopeEventStatusCode': ENVELOPE_STATUS_SENT,
                     'includeDocuments': False,
                 },
                 {
                     'envelopeEventStatusCode': 'Delivered',
                     'includeDocuments': False,
                 },
                 {
                     'envelopeEventStatusCode': 'Completed',
                     'includeDocuments': False,
                 },
                 {
                     'envelopeEventStatusCode': 'Declined',
                     'includeDocuments': False,
                 },
                 {
                     'envelopeEventStatusCode': 'Voided',
                     'includeDocuments': False,
                 },
             ],
             'recipientEvents': [
                 {
                     'recipientEventStatusCode': 'AuthenticationFailed',
                     'includeDocuments': False,
                 },
                 {
                     'recipientEventStatusCode': 'AutoResponded',
                     'includeDocuments': False,
                 },
                 {
                     'recipientEventStatusCode': 'Completed',
                     'includeDocuments': False,
                 },
                 {
                     'recipientEventStatusCode': 'Declined',
                     'includeDocuments': False,
                 },
                 {
                     'recipientEventStatusCode': 'Delivered',
                     'includeDocuments': False,
                 },
                 {
                     'recipientEventStatusCode': RECIPIENT_STATUS_SENT,
                     'includeDocuments': False,
                 },
             ],
         })