You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,14 +54,14 @@ Then create a QuickBooks client object passing in the AuthClient, refresh token,
54
54
company_id='COMPANY_ID',
55
55
)
56
56
57
-
If you need to access a minor version (See [Minor versions](https://developer.intuit.com/docs/0100_quickbooks_online/0200_dev_guides/accounting/minor_versions) for
57
+
If you need to access a minor version (See [Minor versions](https://developer.intuit.com/app/developer/qbo/docs/learn/explore-the-quickbooks-online-api/minor-versions#working-with-minor-versions) for
58
58
details) pass in minorversion when setting up the client:
59
59
60
60
client = QuickBooks(
61
61
auth_client=auth_client,
62
62
refresh_token='REFRESH_TOKEN',
63
63
company_id='COMPANY_ID',
64
-
minorversion=59
64
+
minorversion=69
65
65
)
66
66
67
67
Object Operations
@@ -74,7 +74,9 @@ List of objects:
74
74
75
75
**Note:** The maximum number of entities that can be returned in a
76
76
response is 1000. If the result size is not specified, the default
77
-
number is 100. (See [Intuit developer guide](https://developer.intuit.com/docs/0100_accounting/0300_developer_guides/querying_data) for details)
77
+
number is 100. (See [Query operations and syntax](https://developer.intuit.com/app/developer/qbo/docs/learn/explore-the-quickbooks-online-api/data-queries) for details)
78
+
79
+
**Warning:** You should never allow user input to pass into a query without sanitizing it first! This library DOES NOT sanitize user input!
78
80
79
81
Filtered list of objects:
80
82
@@ -104,6 +106,8 @@ List with custom Where Clause (do not include the `"WHERE"`):
104
106
105
107
customers = Customer.where("Active = True AND CompanyName LIKE 'S%'", qb=client)
106
108
109
+
110
+
107
111
List with custom Where and ordering
108
112
109
113
customers = Customer.where("Active = True AND CompanyName LIKE 'S%'", order_by='DisplayName', qb=client)
@@ -112,7 +116,7 @@ List with custom Where Clause and paging:
112
116
113
117
customers = Customer.where("CompanyName LIKE 'S%'", start_position=1, max_results=25, qb=client)
114
118
115
-
Filtering a list with a custom query (See [Intuit developer guide](https://developer.intuit.com/docs/0100_accounting/0300_developer_guides/querying_data) for
119
+
Filtering a list with a custom query (See [Query operations and syntax](https://developer.intuit.com/app/developer/qbo/docs/learn/explore-the-quickbooks-online-api/data-queries) for
116
120
supported SQL statements):
117
121
118
122
customers = Customer.query("SELECT * FROM Customer WHERE Active = True", qb=client)
Copy file name to clipboardExpand all lines: contributing.md
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,32 +1,35 @@
1
1
# Contributing
2
2
3
-
I am accepting pull requests. Sometimes life gets busy and it takes me a little while to get everything merged in. To help speed up the process, please write tests to cover your changes. I will review/merge them as soon as possible.
3
+
I am accepting pull requests. Sometimes life gets busy and it takes me a little while to get everything reviewed and merged in. To help speed up the process, please write tests to cover your changes. I will review/merge them as soon as possible.
4
4
5
5
# Testing
6
6
7
-
I use [nose](https://nose.readthedocs.io/en/latest/index.html) and [Coverage](https://coverage.readthedocs.io/en/latest/) to run the test suite.
7
+
I use [pytest](https://docs.pytest.org/en/7.4.x/contents.html), [Coverage](https://coverage.readthedocs.io/en/latest/), and [pytest-cov](https://pytest-cov.readthedocs.io/en/latest/) to run the test suite.
8
8
9
9
*WARNING*: The Tests connect to the QBO API and create/modify/delete data. DO NOT USE A PRODUCTION ACCOUNT!
10
10
11
11
## Testing setup:
12
12
13
13
1. Create/login into your [Intuit Developer account](https://developer.intuit.com).
14
14
2. On your Intuit Developer account, create a Sandbox company and an App.
15
-
3. Go to the Intuit Developer OAuth 2.0 Playground and fill out the form to get an **access token** and**refresh token**. You will need to copy the following values into your enviroment variables:
15
+
3. Go to the Intuit Developer OAuth 2.0 Playground and fill out the form to get a**refresh token**. You will need to copy the following values into your enviroment variables:
16
16
```
17
17
export CLIENT_ID="<Client ID>"
18
18
export CLIENT_SECRET="<Client Secret>"
19
-
export COMPANY_ID="<Realm ID>"
20
-
export ACCESS_TOKEN="<Access token>"
19
+
export COMPANY_ID="<Realm ID>"
21
20
export REFRESH_TOKEN="<Refresh token>"
22
21
```
23
22
24
-
*Note*: You will need to update the access token when it expires.
23
+
*Note*: You will need to update the refresh token when it expires.
25
24
26
-
5. Install *nose*and *coverage*. Using Pip:
27
-
`pip install nose coverage`
25
+
5. Install *pytest*, *coverage*, and *pytest-cov*. Using Pip (or whatever):
26
+
`pip install pytest coverage pytest-cov`
28
27
29
-
6. Run `nosetests . --with-coverage --cover-package=quickbooks`
28
+
6. Run all tests: ```pytest --cov```
29
+
Run only unit tests: ```pytest tests/unit --cov```
30
+
Run only integration tests: ```pytest tests/intergration --cov```
31
+
32
+
30
33
31
34
## Creating new tests
32
35
Normal Unit tests that do not connect to the QBO API should be located under `test/unit` Test that connect to QBO API should go under `tests/integration`. Inheriting from `QuickbooksTestCase` will automatically setup `self.qb_client` to use when connecting to QBO.
0 commit comments