Skip to content

Commit 0f0309f

Browse files
authored
fix get_next_page_of_children function for User service (#346)
1 parent 387e1a3 commit 0f0309f

File tree

4 files changed

+94
-13
lines changed

4 files changed

+94
-13
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## Next Release
4+
5+
- Fix `get_next_page_of_children` function for User service with correct filter key
6+
37
## v9.4.0 (2024-07-24)
48

59
- Adds new `Claim` service for filing claims on EasyPost shipments and insurances

easypost/services/user_service.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def get_next_page_of_children(
139139
self._check_has_next_page(collection=children)
140140

141141
params = {
142-
"before_id": children["children"][-1].id,
142+
"after_id": children["children"][-1].id,
143143
"page_size": page_size,
144144
}
145145

tests/cassettes/test_user_children_get_next_page.yaml

+89-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/test_user.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import pytest
22
from easypost.constant import (
3-
_FILTERS_KEY,
43
_TEST_FAILED_INTENTIONALLY_ERROR,
54
NO_MORE_PAGES_ERROR,
65
)
@@ -105,9 +104,6 @@ def test_user_children_get_next_page(prod_client, page_size):
105104
first_id_of_second_page = next_page["children"][0].id
106105

107106
assert first_id_of_first_page != first_id_of_second_page
108-
109-
# Verify that the filters are being passed along for behind-the-scenes reference
110-
assert first_page[_FILTERS_KEY] == next_page[_FILTERS_KEY]
111107
except Exception as e:
112108
if e.message != NO_MORE_PAGES_ERROR:
113109
raise Exception(_TEST_FAILED_INTENTIONALLY_ERROR)

0 commit comments

Comments
 (0)