forked from routablehq/python-quickbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_base.py
More file actions
121 lines (81 loc) · 3.19 KB
/
test_base.py
File metadata and controls
121 lines (81 loc) · 3.19 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import unittest
from quickbooks.objects.base import CustomerMemo, CustomField, Ref, WebAddress, EmailAddress, PhoneNumber, \
Address, LinkedTxn, MetaData, MarkupInfo, AttachableRef, LinkedTxnMixin
from quickbooks.objects.deposit import Deposit
class AddressTests(unittest.TestCase):
def test_unicode(self):
address = Address()
address.Line1 = "123 Main"
address.City = "Joplin"
address.CountrySubDivisionCode = "MO"
address.PostalCode = "12345"
self.assertEquals(str(address), "123 Main Joplin, MO 12345")
class PhoneNumberTests(unittest.TestCase):
def test_unicode(self):
number = PhoneNumber()
number.FreeFormNumber = "555-555-5555"
self.assertEquals(str(number), "555-555-5555")
class EmailAddressTests(unittest.TestCase):
def test_unicode(self):
email = EmailAddress()
email.Address = "email@gmail.com"
self.assertEquals(str(email), "email@gmail.com")
class WebAddressTests(unittest.TestCase):
def test_unicode(self):
url = WebAddress()
url.URI = "www.website.com"
self.assertEquals(str(url), "www.website.com")
class RefTests(unittest.TestCase):
def test_unicode(self):
ref = Ref()
ref.type = "type"
ref.name = "test"
ref.value = 1
self.assertEquals(str(ref), "test")
class CustomFieldTests(unittest.TestCase):
def test_unicode(self):
custom = CustomField()
custom.Name = "name"
self.assertEquals(str(custom), "name")
class CustomerMemoTests(unittest.TestCase):
def test_unicode(self):
memo = CustomerMemo()
memo.value = "value"
self.assertEquals(str(memo), "value")
class LinkedTxnTests(unittest.TestCase):
def test_unicode(self):
linked = LinkedTxn()
linked.TxnId = 1
self.assertEquals(str(linked), "1")
class MetaDataTests(unittest.TestCase):
def test_unicode(self):
meta = MetaData()
meta.CreateTime = "1/1/2000"
self.assertEquals(str(meta), "Created 1/1/2000")
class MarkupInfoTests(unittest.TestCase):
def test_init(self):
markup = MarkupInfo()
self.assertEquals(markup.PercentBased, False)
self.assertEquals(markup.Value, 0)
self.assertEquals(markup.Percent, 0)
self.assertEquals(markup.PriceLevelRef, None)
class AttachableRefTests(unittest.TestCase):
def test_init(self):
attachable = AttachableRef()
attachable.Name = "test"
attachable.IncludeOnSend = False
attachable.Inactive = False
attachable.NoRefOnly = False
self.assertEquals(attachable.LineInfo, None)
self.assertEquals(attachable.IncludeOnSend, False)
self.assertEquals(attachable.Inactive, False)
self.assertEquals(attachable.NoRefOnly, False)
self.assertEquals(attachable.EntityRef, None)
class LinkedTxnMixinTests(unittest.TestCase):
def test_to_linked_txn(self):
deposit = Deposit()
deposit.Id = 100
linked_txn = deposit.to_linked_txn()
self.assertEquals(linked_txn.TxnId, 100)
self.assertEquals(linked_txn.TxnType, "Deposit")
self.assertEquals(linked_txn.TxnLineId, 1)