Skip to content

Commit 45649af

Browse files
committed
Fixed tests.
1 parent 1eca16e commit 45649af

33 files changed

+151
-62
lines changed

quickbooks/objects/account.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
from six import python_2_unicode_compatible
12
from .base import Ref, QuickbooksManagedObject, QuickbooksTransactionEntity
23

34

5+
@python_2_unicode_compatible
46
class Account(QuickbooksManagedObject, QuickbooksTransactionEntity):
57
"""
68
QBO definition: Account is a component of a Chart Of Accounts, and is part of a Ledger. Used to record a total
@@ -36,7 +38,7 @@ def __init__(self):
3638
self.ParentRef = None
3739
self.TaxCodeRef = None
3840

39-
def __unicode__(self):
41+
def __str__(self):
4042
return self.FullyQualifiedName
4143

4244
def to_ref(self):

quickbooks/objects/base.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from six import python_2_unicode_compatible
12
from ..mixins import ToJsonMixin, FromJsonMixin, ReadMixin, ListMixin, UpdateMixin
23

34

@@ -22,12 +23,13 @@ class QuickbooksManagedObject(QuickbooksBaseObject, ReadMixin, ListMixin, Update
2223
pass
2324

2425

26+
@python_2_unicode_compatible
2527
class MetaData:
2628
def __init__(self):
2729
self.CreateTime = ""
2830
self.LastUpdatedTime = ""
2931

30-
def __unicode__(self):
32+
def __str__(self):
3133
return "Created {0}".format(self.CreateTime)
3234

3335

@@ -41,6 +43,7 @@ def to_linked_txn(self):
4143
return linked_txn
4244

4345

46+
@python_2_unicode_compatible
4447
class Address(ToJsonMixin, FromJsonMixin):
4548
def __init__(self):
4649
self.Id = None
@@ -52,34 +55,38 @@ def __init__(self):
5255
self.Lat = ""
5356
self.Long = ""
5457

55-
def __unicode__(self):
58+
def __str__(self):
5659
return "{0} {1}, {2} {3}".format(self.Line1, self.City, self.CountrySubDivisionCode, self.PostalCode)
5760

5861

62+
@python_2_unicode_compatible
5963
class PhoneNumber(ToJsonMixin, FromJsonMixin):
6064
def __init__(self):
6165
self.FreeFormNumber = ""
6266

63-
def __unicode__(self):
67+
def __str__(self):
6468
return self.FreeFormNumber
6569

6670

71+
@python_2_unicode_compatible
6772
class EmailAddress(ToJsonMixin, FromJsonMixin):
6873
def __init__(self):
6974
self.Address = ""
7075

71-
def __unicode__(self):
76+
def __str__(self):
7277
return self.Address
7378

7479

80+
@python_2_unicode_compatible
7581
class WebAddress(ToJsonMixin, FromJsonMixin):
7682
def __init__(self):
7783
self.URI = ""
7884

79-
def __unicode__(self):
85+
def __str__(self):
8086
return self.URI
8187

8288

89+
@python_2_unicode_compatible
8390
class Ref(ToJsonMixin, FromJsonMixin):
8491
class_dict = {}
8592
list_dict = {}
@@ -89,20 +96,22 @@ def __init__(self):
8996
self.name = ""
9097
self.type = ""
9198

92-
def __unicode__(self):
99+
def __str__(self):
93100
return self.name
94101

95102

103+
@python_2_unicode_compatible
96104
class CustomField(ToJsonMixin, FromJsonMixin):
97105
def __init__(self):
98106
self.Type = ""
99107
self.Name = ""
100108
self.StringValue = ""
101109

102-
def __unicode__(self):
110+
def __str__(self):
103111
return self.Name
104112

105113

114+
@python_2_unicode_compatible
106115
class LinkedTxn(QuickbooksBaseObject):
107116
qbo_object_name = "LinkedTxn"
108117

@@ -112,16 +121,17 @@ def __init__(self):
112121
self.TxnType = 0
113122
self.TxnLineId = 0
114123

115-
def __unicode__(self):
124+
def __str__(self):
116125
return str(self.TxnId)
117126

118127

128+
@python_2_unicode_compatible
119129
class CustomerMemo(QuickbooksBaseObject):
120130
def __init__(self):
121131
super(CustomerMemo, self).__init__()
122132
self.Value = ""
123133

124-
def __unicode__(self):
134+
def __str__(self):
125135
return self.Value
126136

127137

quickbooks/objects/batchrequest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from six import python_2_unicode_compatible
12
from ..mixins import ToJsonMixin, FromJsonMixin
23

34

@@ -7,6 +8,7 @@ class BatchOperation(object):
78
DELETE = "delete"
89

910

11+
@python_2_unicode_compatible
1012
class FaultError(FromJsonMixin):
1113
qbo_object_name = "Error"
1214

@@ -18,7 +20,7 @@ def __init__(self):
1820
self.Detail = ""
1921
self.element = ""
2022

21-
def __unicode__(self):
23+
def __str__(self):
2224
return "{0} ({1})".format(self.Message, self.code)
2325

2426

quickbooks/objects/bill.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
from six import python_2_unicode_compatible
12
from .base import QuickbooksBaseObject, Ref, LinkedTxn, QuickbooksManagedObject, QuickbooksTransactionEntity, \
23
LinkedTxnMixin, MarkupInfo
34
from .tax import TxnTaxDetail
45

56

7+
@python_2_unicode_compatible
68
class AccountBasedExpenseLineDetail(QuickbooksBaseObject):
79
class_dict = {
810
"CustomerRef": Ref,
@@ -22,7 +24,7 @@ def __init__(self):
2224
self.AccountRef = None
2325
self.TaxCodeRef = None
2426

25-
def __unicode__(self):
27+
def __str__(self):
2628
return self.BillableStatus
2729

2830

@@ -50,6 +52,7 @@ def __init__(self):
5052
self.CustomerRef = None
5153

5254

55+
@python_2_unicode_compatible
5356
class BillLine(QuickbooksBaseObject):
5457
class_dict = {
5558
"AccountBasedExpenseLineDetail": AccountBasedExpenseLineDetail,
@@ -72,10 +75,11 @@ def __init__(self):
7275
self.AccountBasedExpenseLineDetail = None
7376
self.ItemBasedExpenseLineDetail = None
7477

75-
def __unicode__(self):
78+
def __str__(self):
7679
return str(self.Amount)
7780

7881

82+
@python_2_unicode_compatible
7983
class Bill(QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin):
8084
"""
8185
QBO definition: A Bill entity is an AP transaction representing a request-for-payment from a third party for
@@ -121,5 +125,5 @@ def __init__(self):
121125
self.LinkedTxn = []
122126
self.Line = []
123127

124-
def __unicode__(self):
128+
def __str__(self):
125129
return str(self.Balance)

quickbooks/objects/billpayment.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
from six import python_2_unicode_compatible
12
from .base import QuickbooksBaseObject, Ref, LinkedTxn, QuickbooksManagedObject, LinkedTxnMixin, \
23
QuickbooksTransactionEntity
34

45

6+
@python_2_unicode_compatible
57
class CheckPayment(QuickbooksBaseObject):
68
class_dict = {
79
"BankAccountRef": Ref
@@ -14,7 +16,7 @@ def __init__(self):
1416
self.PrintStatus = ""
1517
self.BankAccountRef = None
1618

17-
def __unicode__(self):
19+
def __str__(self):
1820
return self.PrintStatus
1921

2022

@@ -30,6 +32,7 @@ def __init__(self):
3032
self.CCAccountRef = None
3133

3234

35+
@python_2_unicode_compatible
3336
class BillPaymentLine(QuickbooksBaseObject):
3437
list_dict = {
3538
"LinkedTxn": LinkedTxn
@@ -42,10 +45,11 @@ def __init__(self):
4245
self.Amount = 0
4346
self.LinkedTxn = []
4447

45-
def __unicode__(self):
48+
def __str__(self):
4649
return str(self.Amount)
4750

4851

52+
@python_2_unicode_compatible
4953
class BillPayment(QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin):
5054
"""
5155
QBO definition: A BillPayment entity represents the financial transaction of payment of bills that the
@@ -89,5 +93,5 @@ def __init__(self):
8993

9094
self.Line = []
9195

92-
def __unicode__(self):
96+
def __str__(self):
9397
return str(self.TotalAmt)

quickbooks/objects/budget.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
from six import python_2_unicode_compatible
12
from .base import QuickbooksBaseObject, Ref, QuickbooksManagedObject, QuickbooksTransactionEntity
23

34

5+
@python_2_unicode_compatible
46
class BudgetDetail(QuickbooksBaseObject):
57
class_dict = {
68
"AccountRef": Ref,
@@ -19,10 +21,11 @@ def __init__(self):
1921
self.ClassRef = None
2022
self.DepartmentRef = None
2123

22-
def __unicode__(self):
24+
def __str__(self):
2325
return str(self.Amount)
2426

2527

28+
@python_2_unicode_compatible
2629
class Budget(QuickbooksManagedObject, QuickbooksTransactionEntity):
2730
"""
2831
QBO definition: The Budget endpoint allows you to retrieve the current state of budgets already set up in the user's
@@ -48,6 +51,6 @@ def __init__(self):
4851

4952
self.BudgetDetail = []
5053

51-
def __unicode__(self):
54+
def __str__(self):
5255
return self.Name
5356

quickbooks/objects/creditmemo.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
from six import python_2_unicode_compatible
12
from .base import QuickbooksBaseObject, Address, EmailAddress, Ref, CustomField, CustomerMemo, QuickbooksManagedObject, \
23
LinkedTxnMixin, LinkedTxn, MarkupInfo
34
from .tax import TxnTaxDetail
45

56

7+
@python_2_unicode_compatible
68
class SalesItemLineDetail(QuickbooksBaseObject):
79
class_dict = {
810
"ItemRef": Ref,
@@ -25,7 +27,7 @@ def __init__(self):
2527
self.ClassRef = None
2628
self.PriceLevelRef = None
2729

28-
def __unicode__(self):
30+
def __str__(self):
2931
return str(self.UnitPrice)
3032

3133

@@ -78,6 +80,7 @@ def __init__(self):
7880
self.TaxCodeRef = None
7981

8082

83+
@python_2_unicode_compatible
8184
class CreditMemoLine(QuickbooksBaseObject):
8285
class_dict = {
8386
"SalesItemLineDetail": SalesItemLineDetail,
@@ -107,10 +110,11 @@ def __init__(self):
107110
self.LinkedTxn = []
108111
self.CustomField = []
109112

110-
def __unicode__(self):
113+
def __str__(self):
111114
return "[{0}] {1} {2}".format(self.LineNum, self.Description, self.Amount)
112115

113116

117+
@python_2_unicode_compatible
114118
class CreditMemo(QuickbooksManagedObject, LinkedTxnMixin):
115119
"""
116120
QBO definition: The CreditMemo is a financial transaction representing a refund or credit of payment or part
@@ -168,5 +172,5 @@ def __init__(self):
168172
self.CustomField = []
169173
self.Line = []
170174

171-
def __unicode__(self):
175+
def __str__(self):
172176
return str(self.TotalAmt)

quickbooks/objects/customer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
from six import python_2_unicode_compatible
12
from .base import Address, PhoneNumber, EmailAddress, WebAddress, Ref, QuickbooksManagedObject, \
23
QuickbooksTransactionEntity
34

45

6+
@python_2_unicode_compatible
57
class Customer(QuickbooksManagedObject, QuickbooksTransactionEntity):
68
"""
79
QBO definition: A customer is a consumer of the service or product that your business offers. The Customer object
@@ -70,7 +72,7 @@ def __init__(self):
7072
self.ParentRef = None
7173
self.ARAccountRef = None
7274

73-
def __unicode__(self):
75+
def __str__(self):
7476
return self.DisplayName
7577

7678
def to_ref(self):

quickbooks/objects/department.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
from six import python_2_unicode_compatible
12
from .base import QuickbooksManagedObject, QuickbooksTransactionEntity, Ref
23

34

5+
@python_2_unicode_compatible
46
class Department(QuickbooksManagedObject, QuickbooksTransactionEntity):
57
"""
68
QBO definition: The Department entity provides a way to track different segments of the business, divisions, or
@@ -24,7 +26,7 @@ def __init__(self):
2426
self.FullyQualifiedName = ""
2527
self.Active = True
2628

27-
def __unicode__(self):
29+
def __str__(self):
2830
return self.Name
2931

3032
def to_ref(self):

quickbooks/objects/deposit.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from six import python_2_unicode_compatible
12
from .base import QuickbooksBaseObject, Ref, LinkedTxn, QuickbooksManagedObject, LinkedTxnMixin, \
23
QuickbooksTransactionEntity, CustomField
34

@@ -48,6 +49,7 @@ def __init__(self):
4849
self.TxnType = ""
4950

5051

52+
@python_2_unicode_compatible
5153
class DepositLine(QuickbooksBaseObject):
5254
class_dict = {
5355
"DepositToAccountRef": Ref,
@@ -71,10 +73,11 @@ def __init__(self):
7173
self.LinkedTxn = []
7274
self.CustomField = []
7375

74-
def __unicode__(self):
76+
def __str__(self):
7577
return str(self.Amount)
7678

7779

80+
@python_2_unicode_compatible
7881
class Deposit(QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin):
7982
"""
8083
QBO definition: A deposit object is a transaction that records one or more deposits of the following types:
@@ -118,5 +121,5 @@ def __init__(self):
118121
self.AttachableRef = None
119122
self.Line = []
120123

121-
def __unicode__(self):
124+
def __str__(self):
122125
return str(self.TotalAmt)

0 commit comments

Comments
 (0)