File tree Expand file tree Collapse file tree 5 files changed +26
-8
lines changed Expand file tree Collapse file tree 5 files changed +26
-8
lines changed Original file line number Diff line number Diff line change
1
+ .cache
1
2
.DS_Store
2
3
.AppleDouble
3
4
.LSOverride
6
7
.Spotlight-V100
7
8
.Trashes
8
9
10
+ # virtual environment
11
+ venv
12
+
9
13
/build
10
14
/dist
11
15
/MANIFEST
20
24
test
21
25
virtualenv
22
26
.virtualenv
23
- .idea
27
+ .idea
Original file line number Diff line number Diff line change 1
1
### NEXT (unreleased)
2
2
3
+ ### 3.6.4 2018-04-09
4
+
5
+ * Update user tests
6
+
3
7
### 3.6.3 2018-02-05
4
8
5
9
* Fix issue with responses that contain an ` api_key ` field (gh-67 )
Original file line number Diff line number Diff line change 1
- 3.6.3
1
+ 3.6.4
Original file line number Diff line number Diff line change 5
5
6
6
child_user = easypost .User .create (
7
7
name = 'Python All-Things-Testing' ,
8
- password = 'password1' ,
9
- password_confirmation = 'password1' ,
10
- phone_number = '7778675309'
8
+ phone_number = '555-555-5555'
11
9
)
12
10
id = child_user .id
13
11
Original file line number Diff line number Diff line change 1
1
# Unit tests related to 'Users' (https://www.easypost.com/docs/api#users).
2
2
3
3
import easypost
4
+ import pytest
4
5
5
6
6
7
def test_child_user_create (prod_api_key ):
7
8
# Create an address and then verify some fields to test whether it was created just fine.
8
9
child_user = easypost .User .create (
9
- name = 'Python All-Things-Testing' ,
10
- password = 'password1' ,
11
- password_confirmation = 'password1' ,
10
+ name = 'Python All-Things-Testing'
12
11
)
12
+
13
+ with pytest .raises (easypost .Error ) as caught_exception :
14
+ easypost .User .create (
15
+ name = 'Python All-Things-Testing' ,
16
+ password = 'super-secret-password' ,
17
+ password_confirmation = 'super-secret-password'
18
+ )
19
+
20
+ exception = caught_exception .value .json_body
21
+ error_msg = 'Child users must be created via the API and must not contain an email or password.'
22
+ assert exception ['error' ]['message' ] == error_msg
23
+ assert exception ['error' ]['code' ] == 'USER.INVALID'
24
+
13
25
child_id = child_user .id
14
26
assert child_id is not None
15
27
You can’t perform that action at this time.
0 commit comments