11import unittest
22import base64
33import os
4- import datetime
54from docusign_esign import Document , Signer , EnvelopeDefinition , SignHere , Tabs , \
65 Recipients , CarbonCopy , EnvelopeTemplate , Checkbox , List , ListItem , Text , Radio , RadioGroup , Number , TemplateRole , \
76 CompositeTemplate , ServerTemplate , InlineTemplate , CustomFields , TextCustomField
1413from app .eSignature .examples .eg016_set_tab_values import Eg016SetTabValuesController
1514from .test_helper import TestHelper , DATA , DS_CONFIG
1615
17- unittest .TestLoader .sortTestMethodsUsing = None
18-
1916
2017class Testing (unittest .TestCase ):
2118 TEMPLATE_ID = ""
@@ -27,7 +24,6 @@ def setUpClass(cls):
2724 cls .access_token = results ["access_token" ]
2825 cls .account_id = results ["account_id" ]
2926 cls .base_path = results ["base_path" ]
30- cls .test_helper = TestHelper ()
3127
3228 def test_embedded_signing_worker (self ):
3329 envelope_args = {
@@ -87,39 +83,6 @@ def test_embedded_signing_make_envelope(self):
8783 )]
8884 )
8985
90- expected = {
91- "emailSubject" : "Please sign this document" ,
92- "documents" : [
93- {
94- "documentBase64" : base64_file_content ,
95- "name" : "Lorem Ipsum" ,
96- "fileExtension" : "pdf" ,
97- "documentId" : "3" ,
98- }
99- ],
100- "recipients" : {
101- "signers" : [
102- {
103- "email" : DS_CONFIG ["signer_email" ],
104- "name" : DS_CONFIG ["signer_name" ],
105- "clientUserId" : DATA ["signer_client_id" ],
106- "recipientId" : '1' ,
107- "tabs" : {
108- "signHereTabs" : [
109- {
110- "anchorString" : "/sn1/" ,
111- "anchorYOffset" : "10" ,
112- "anchorUnits" : "pixels" ,
113- "anchorXOffset" : "20"
114- }
115- ]
116- }
117- }
118- ]
119- },
120- "status" : 'sent'
121- }
122-
12386 results = Eg001EmbeddedSigningController .make_envelope (envelope_args )
12487
12588 self .assertIsNotNone (results )
@@ -140,7 +103,8 @@ def test_sign_via_email(self):
140103 "envelope_args" : envelope_args
141104 }
142105
143- results = Eg002SigningViaEmailController .worker (args , DATA ["test_docx_file" ], DATA ["test_pdf_file" ])
106+ results = Eg002SigningViaEmailController .worker (args , os .path .join ("../../" , DATA ["test_docx_file" ]),
107+ os .path .join ("../../" , DATA ["test_pdf_file" ]))
144108
145109 self .assertIsNotNone (results )
146110 self .assertIsNotNone (results ["envelope_id" ])
@@ -235,7 +199,8 @@ def test_sign_via_email_make_envelope(self):
235199 )
236200 )
237201
238- envelope = Eg002SigningViaEmailController .make_envelope (envelope_args , os .path .abspath (DATA ["test_docx_file" ]), os .path .abspath (DATA ["test_pdf_file" ]))
202+ envelope = Eg002SigningViaEmailController .make_envelope (envelope_args , os .path .abspath (DATA ["test_docx_file" ]),
203+ os .path .abspath (DATA ["test_pdf_file" ]))
239204
240205 self .assertIsNotNone (envelope )
241206 self .assertEquals (envelope , expected )
@@ -447,7 +412,6 @@ def test_use_template(self):
447412 self .assertIsNotNone (result )
448413 self .assertIsNotNone (result ["envelope_id" ])
449414
450-
451415 def test_use_template_make_envelope (self ):
452416 envelope_args = {
453417 "signer_email" : DS_CONFIG ["signer_email" ],
@@ -479,7 +443,7 @@ def test_use_template_make_envelope(self):
479443 self .assertIsNotNone (result )
480444 self .assertEquals (result , expected )
481445
482- def test_add_doc_to_template (self ):
446+ def test_include_doc_to_template (self ):
483447 envelope_args = {
484448 "signer_email" : DS_CONFIG ["signer_email" ],
485449 "signer_name" : DS_CONFIG ["signer_name" ],
@@ -504,7 +468,7 @@ def test_add_doc_to_template(self):
504468 self .assertIsNotNone (result ["envelope_id" ])
505469 self .assertIsNotNone (result ["redirect_url" ])
506470
507- def test_add_doc_to_template_make_envelope (self ):
471+ def test_include_doc_to_template_make_envelope (self ):
508472 envelope_args = {
509473 "signer_email" : DS_CONFIG ["signer_email" ],
510474 "signer_name" : DS_CONFIG ["signer_name" ],
@@ -615,7 +579,7 @@ def test_add_doc_to_template_make_envelope(self):
615579 self .assertIsNotNone (envelope )
616580 self .assertEquals (envelope , expected )
617581
618- def test_add_doc_to_template_html_doc (self ):
582+ def test_include_doc_to_template_html_doc (self ):
619583 envelope_args = {
620584 "signer_email" : DS_CONFIG ["signer_email" ],
621585 "signer_name" : DS_CONFIG ["signer_name" ],
@@ -755,5 +719,6 @@ def test_set_tab_values_make_envelope(self):
755719 self .assertIsNotNone (envelope )
756720 self .assertEquals (envelope , expected )
757721
722+
758723if __name__ == '__main__' :
759724 unittest .main ()
0 commit comments