Exemplo n.º 1
0
    def test_serialize_signer(self):
        tab = SignHereTab(documentId=1,
                          pageNumber=2,
                          xPosition=100,
                          yPosition=200)
        signer = Signer(clientUserId='some ID in your DB',
                        email='*****@*****.**',
                        name='My Name',
                        recipientId=1,
                        tabs=[tab])
        self.assertEqual(
            signer.to_dict(), {
                'clientUserId': 'some ID in your DB',
                'email': '*****@*****.**',
                'emailNotification': None,
                'name': 'My Name',
                'recipientId': 1,
                'routingOrder': 0,
                'tabs': {
                    'signHereTabs': [tab.to_dict()],
                },
                'accessCode': None,
            })

        tab = ApproveTab(documentId=1,
                         pageNumber=2,
                         xPosition=100,
                         yPosition=200)
        signer = Signer(clientUserId='some ID in your DB',
                        email='*****@*****.**',
                        emailSubject=u'Subject',
                        emailBody=u'Body',
                        supportedLanguage='de',
                        name='My Name',
                        recipientId=1,
                        routingOrder=100,
                        tabs=[tab],
                        accessCode='toto')
        self.assertEqual(
            signer.to_dict(), {
                'clientUserId': 'some ID in your DB',
                'email': '*****@*****.**',
                'emailNotification': {
                    'emailBody': u'Body',
                    'emailSubject': u'Subject',
                    'supportedLanguage': 'de',
                },
                'name': 'My Name',
                'recipientId': 1,
                'routingOrder': 100,
                'tabs': {
                    'approveTabs': [tab.to_dict()],
                },
                'accessCode': 'toto',
            })
Exemplo n.º 2
0
 def test_serialize_sign_here_tab(self):
     tab = SignHereTab(documentId=2,
                       pageNumber=1,
                       xPosition=100,
                       yPosition=200)
     self.assertEqual(
         tab.to_dict(), {
             'documentId': 2,
             'recipientId': None,
             'pageNumber': 1,
             'xPosition': 100,
             'yPosition': 200,
         })