Skip to content

Commit

Permalink
Update readme for from_json
Browse files Browse the repository at this point in the history
  • Loading branch information
ej2 committed May 20, 2024
1 parent 93450fc commit d77b308
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ Converting an object to JSON data:

Loading JSON data into a quickbooks object:

account = Account()
account.from_json(
account = Account.from_json(
{
"AccountType": "Accounts Receivable",
"AcctNum": "123123",
"Name": "MyJobs"
}
)
Expand Down
9 changes: 9 additions & 0 deletions tests/integration/test_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ def test_update(self):

query_account = Account.get(account.Id, qb=self.qb_client)
self.assertEqual(query_account.Name, "Updated Name {0}".format(self.account_number))

def test_create_using_from_json(self):
account = Account.from_json({
"AcctNum": self.account_number,
"Name": self.name,
"AccountSubType": "CashOnHand"
})

account.save(qb=self.qb_client)

0 comments on commit d77b308

Please sign in to comment.