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())