Ejemplo n.º 1
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())
Ejemplo n.º 2
0
 def test_serialize_document(self):
     document = Document(documentId=2, name='document.pdf')
     self.assertEqual(document.to_dict(), {
         'documentId': 2,
         'name': 'document.pdf',
     })