@@ -16,9 +16,10 @@ def test_list_mobile_device_categories(client: TestClient) -> None:
1616 ]
1717
1818 for resource , slug in cases :
19- body = client .get (f"/v1/{ resource } " ).json ()
20- assert body ["count" ] >= 1
21- assert any (item ["slug" ] == slug for item in body ["results" ])
19+ list_body = client .get (f"/v1/{ resource } " ).json ()
20+ detail_body = client .get (f"/v1/{ resource } /{ slug } " ).json ()
21+ assert list_body ["count" ] >= 1
22+ assert detail_body ["slug" ] == slug
2223
2324
2425def test_mobile_device_detail_includes_variant_fields (client : TestClient ) -> None :
@@ -35,12 +36,14 @@ def test_mobile_device_detail_includes_variant_fields(client: TestClient) -> Non
3536def test_mobile_device_filters (client : TestClient ) -> None :
3637 ensure_mobile_device_fixtures ()
3738 brand_body = client .get ("/v1/watches?brand=samsung" ).json ()
38- assert { item [ "slug" ] for item in brand_body [ "results" ]} == {
39- "galaxy-watch-global-bluetooth-42mm"
39+ assert "galaxy-watch-global-bluetooth-42mm" in {
40+ item [ "slug" ] for item in brand_body [ "results" ]
4041 }
4142
4243 base_body = client .get ("/v1/tablets?base_model_slug=ipad-pro-11-m4" ).json ()
43- assert {item ["slug" ] for item in base_body ["results" ]} == {"ipad-pro-11-m4-wifi-8gb-256gb" }
44+ assert "ipad-pro-11-m4-wifi-8gb-256gb" in {
45+ item ["slug" ] for item in base_body ["results" ]
46+ }
4447
4548
4649def test_mobile_device_unknown_slug_404 (client : TestClient ) -> None :
0 commit comments