Skip to content

Commit

Permalink
Merge pull request #65 from wetcoastdev/master
Browse files Browse the repository at this point in the history
Downloading PDF in python3
  • Loading branch information
ej2 authored Jan 23, 2017
2 parents 665621d + a83f328 commit d0ac3b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion quickbooks/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class QuickbooksPdfDownloadable(object):
qbo_object_name = ""

def download_pdf(self, qb=None):
if self.Id and self.Id > 0 and qb is not None:
if self.Id and int(self.Id) > 0 and qb is not None:
return qb.download_pdf(self.qbo_object_name, self.Id)
else:
raise QuickbooksException(
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ def setUp(self):
@patch('quickbooks.client.QuickBooks.download_pdf')
def test_download_invoice(self, download_pdf):
receipt = SalesReceipt()
receipt.Id = 1
receipt.Id = "1"

receipt.download_pdf(self.qb_client)
download_pdf.assert_called_once_with('SalesReceipt', 1)
download_pdf.assert_called_once_with('SalesReceipt', "1")

def test_download_missing_id(self):
from quickbooks.exceptions import QuickbooksException
Expand Down

0 comments on commit d0ac3b0

Please sign in to comment.