forked from routablehq/python-quickbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_taxcode.py
More file actions
32 lines (24 loc) · 1.06 KB
/
test_taxcode.py
File metadata and controls
32 lines (24 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
import unittest
from quickbooks.auth import Oauth1SessionManager
from quickbooks.client import QuickBooks
from quickbooks.objects.taxcode import TaxCode
class TaxCodeTest(unittest.TestCase):
def setUp(self):
self.session_manager = Oauth1SessionManager(
sandbox=True,
consumer_key=os.environ.get('CONSUMER_KEY'),
consumer_secret=os.environ.get('CONSUMER_SECRET'),
access_token=os.environ.get('ACCESS_TOKEN'),
access_token_secret=os.environ.get('ACCESS_TOKEN_SECRET'),
)
self.qb_client = QuickBooks(
session_manager=self.session_manager,
sandbox=True,
company_id=os.environ.get('COMPANY_ID')
)
def test_get_all(self):
tax_codes = TaxCode.all(max_results=1, qb=self.qb_client)
# KNOWN Quickbooks bug - TaxCode query returns 3 extra items:
# https://intuitdeveloper.lc.intuit.com/questions/1398164-setting-maxresults-on-taxcode-query-returns-incorrect-number-of-records
self.assertEquals(len(tax_codes), 4)