Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ej2 committed Aug 7, 2024
1 parent f4e7661 commit 501ba21
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

* 0.9.10 (August 7, 2024)
* Update intuit-oauth dependency
* Fix issues with Invoice Sharable Link
* Added optional params to get

* 0.9.9 (July 9, 2024)
* Removed simplejson
* Added use_decimal option (See PR: https://github.com/ej2/python-quickbooks/pull/356 for details)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def read(*parts):
return fp.read()


VERSION = (0, 9, 9)
VERSION = (0, 9, 10)
version = '.'.join(map(str, VERSION))

setup(
Expand Down
1 change: 1 addition & 0 deletions tests/unit/objects/test_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_to_ref(self):
self.assertEqual(ref.name, 1) # should be DocNumber
self.assertEqual(ref.value, 2) # should be Id


class DeliveryInfoTests(unittest.TestCase):
def test_init(self):
info = DeliveryInfo()
Expand Down
11 changes: 10 additions & 1 deletion tests/unit/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,16 @@ def test_get_single_object(self, make_req):

qb_client.get_single_object("test", 1)
url = "https://sandbox-quickbooks.api.intuit.com/v3/company/1234/test/1/"
make_req.assert_called_with("GET", url, {})
make_req.assert_called_with("GET", url, {}, params=None)

@patch('quickbooks.client.QuickBooks.make_request')
def test_get_single_object_with_params(self, make_req):
qb_client = client.QuickBooks(auth_client=self.auth_client)
qb_client.company_id = "1234"

qb_client.get_single_object("test", 1, params={'param':'value'})
url = "https://sandbox-quickbooks.api.intuit.com/v3/company/1234/test/1/"
make_req.assert_called_with("GET", url, {}, params={'param':'value'})

@patch('quickbooks.client.QuickBooks.process_request')
def test_make_request(self, process_request):
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class ReadMixinTest(QuickbooksUnitTestCase):
@patch('quickbooks.mixins.QuickBooks.get_single_object')
def test_get(self, get_single_object):
Department.get(1)
get_single_object.assert_called_once_with("Department", pk=1)
get_single_object.assert_called_once_with("Department", pk=1, params=None)

def test_get_with_qb(self):
with patch.object(self.qb_client, 'get_single_object') as get_single_object:
Expand Down

0 comments on commit 501ba21

Please sign in to comment.