Skip to content

Commit 11b42b3

Browse files
committed
Test case for issue 22
1. Change eg002 to include Date and DateSign tabs on the documents 2. Change eg005 to test the envelope_api.list_tabs API call Results: the envelope_api.list_tabs call fails if the recipient has a Date tab.
1 parent 79d573e commit 11b42b3

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

app/eg002_signing_via_email.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,19 @@ def make_envelope(args):
197197
sign_here2 = SignHere(
198198
anchor_string = '/sn1/', anchor_units = 'pixels',
199199
anchor_y_offset = '10', anchor_x_offset = '20')
200+
date1 = Date(
201+
anchor_string = '**signature_1**', anchor_units = 'pixels',
202+
anchor_y_offset = '10', anchor_x_offset = '100',
203+
width = 75, tab_label = 'Date tab', name = 'Date tab' )
204+
dateSigned1 = DateSigned(
205+
anchor_string = '**signature_1**', anchor_units = 'pixels',
206+
anchor_y_offset = '10', anchor_x_offset = '220',
207+
tab_label = 'Date signed tab' )
200208

201209
# Add the tabs model (including the sign_here tabs) to the signer
202210
# The Tabs object wants arrays of the different field/tab types
203-
signer1.tabs = Tabs(sign_here_tabs=[sign_here1, sign_here2])
211+
signer1.tabs = Tabs(sign_here_tabs=[sign_here1, sign_here2],
212+
date_tabs=[date1], date_signed_tabs=[dateSigned1])
204213

205214
# Add the recipients to the envelope object
206215
recipients = Recipients(signers=[signer1], carbon_copies=[cc1])

app/eg005_envelope_recipients.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
"""005: List an envelope's recipients and status"""
1+
"""005: List an envelope's recipients and status
2+
3+
Also, for issue 22, lists tabs for the signer recipient.
4+
See https://github.com/docusign/docusign-python-client/issues/22
5+
"""
26

37
from flask import render_template, url_for, redirect, session, flash, request
48
from os import path
@@ -54,7 +58,7 @@ def create_controller():
5458
return render_template("example_done.html",
5559
title="Envelope recipients results",
5660
h1="List the envelope's recipients and their status",
57-
message="Results from the EnvelopesRecipients::list method:",
61+
message="Results from the EnvelopeRecipientTabs::list method. API method: envelope_api.list_tabs",
5862
json=json.dumps(json.dumps(results.to_dict()))
5963
)
6064
elif not token_ok:
@@ -90,7 +94,12 @@ def worker(args):
9094
envelope_api = EnvelopesApi(api_client)
9195
results = envelope_api.list_recipients(args['account_id'], args['envelope_id'])
9296

93-
return results
97+
recipientId = results.signers[0].recipient_id
98+
# Call the EnvelopeRecipientTabs: list method
99+
envelope_api = EnvelopesApi(api_client)
100+
results2 = envelope_api.list_tabs(args['account_id'], args['envelope_id'], recipientId)
101+
102+
return results2
94103
# ***DS.snippet.0.end
95104

96105

app/templates/eg005_envelope_recipients.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<!-- extend base layout --> {% extends "base.html" %} {% block content %}
22

3-
<h4>5. List an envelope's recipients and their status</h4>
4-
<p>List the envelope's recipients, including their current status.</p>
3+
<h4>5. TEST for Issue 22: EnvelopeRecipientTabs::list</h4>
54

65
{% if show_doc %}
76
<p><a target='_blank' href='{{ documentation | safe }}'>Documentation</a> about this example.</p>

app/templates/home.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ <h1 class="display-4">Welcome!</h1>
1818

1919
<div id="index-page">
2020
<h2>Welcome</h2>
21-
<p>This launcher both demonstrates use of the OAuth Authorization Code Grant flow and includes multiple
22-
usage examples for the DocuSign eSignature REST API.</p>
21+
<h3><a href="eg005">Test for Issue 22</a>: EnvelopeRecipientTabs::list</h3>
2322

2423
{% if show_doc %}
2524
<p><a target='_blank' href='{{ documentation | safe }}'>Documentation</a> on using OAuth Authorization Code Grant from a

0 commit comments

Comments
 (0)