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
44 lines (30 loc) · 1.12 KB
/
test_taxcode.py
File metadata and controls
44 lines (30 loc) · 1.12 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
32
33
34
35
36
37
38
39
40
41
42
43
44
import unittest
from quickbooks import QuickBooks
from quickbooks.objects.taxcode import TaxCode, TaxRateDetail, TaxRateList
class TaxCodeTests(unittest.TestCase):
def test_unicode(self):
taxcode = TaxCode()
taxcode.Name = "test"
self.assertEquals(str(taxcode), "test")
def test_valid_object_name(self):
obj = TaxCode()
client = QuickBooks()
result = client.isvalid_object_name(obj.qbo_object_name)
self.assertTrue(result)
def test_to_ref(self):
taxcode = TaxCode()
taxcode.Id = 2
taxcode.Name = "test"
ref = taxcode.to_ref()
self.assertEquals(ref.name, "test")
self.assertEquals(ref.type, "TaxCode")
self.assertEquals(ref.value, 2)
class TaxRateDetailTests(unittest.TestCase):
def test_init(self):
tax_rate = TaxRateDetail()
self.assertEquals(tax_rate.TaxOrder, 0)
self.assertEquals(tax_rate.TaxTypeApplicable, "")
class TaxRateListTests(unittest.TestCase):
def test_init(self):
tax_rate_list = TaxRateList()
self.assertEquals(tax_rate_list.TaxRateDetail, [])