Skip to content

Commit 10ed26a

Browse files
change type to isinstance
1 parent 769bb7f commit 10ed26a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/test_product.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def test_products_pagination(self, create_product):
221221
assert "products" in data1
222222
assert len(data1["products"]) == 10
223223
assert data1["cursor"]["prev"] is None
224-
assert type(data1["cursor"]["next"]) is str
224+
assert isinstance(data1["cursor"]["next"], str)
225225

226226
# Page 2
227227
next_cursor = data1["cursor"]["next"]
@@ -231,4 +231,4 @@ def test_products_pagination(self, create_product):
231231
assert "products" in data2
232232
assert len(data2["products"]) == 5
233233
assert data2["cursor"]["next"] is None
234-
assert type(data2["cursor"]["prev"]) is str
234+
assert isinstance(data2["cursor"]["prev"], str)

tests/test_relationships.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def test_get_category_products_populated_with_pagination(self, create_category,
225225
next_cursor = page1["cursor"]["next"]
226226
page2 = self.client.get(f"/categories/{category['id']}/products?cursor={next_cursor}").get_json()
227227
assert page2["cursor"]["next"] is None
228-
assert type(page2["cursor"]["prev"]) is str
228+
assert isinstance(page2["cursor"]["prev"], str)
229229
assert len(page1["products"]) == 10
230230
assert len(page2["products"]) == 2
231231

@@ -265,7 +265,7 @@ def test_get_subcategory_products_populated_with_pagination(self, create_subcate
265265
next_cursor = page1["cursor"]["next"]
266266
page2 = self.client.get(f"/subcategories/{subcategory['id']}/products?cursor={next_cursor}").get_json()
267267
assert page2["cursor"]["next"] is None
268-
assert type(page2["cursor"]["prev"]) is str
268+
assert isinstance(page2["cursor"]["prev"], str)
269269
assert len(page1["products"]) == 10
270270
assert len(page2["products"]) == 1
271271

0 commit comments

Comments
 (0)