From 9841870055ef8e05ae656d6536d2efd91ba74575 Mon Sep 17 00:00:00 2001 From: gabe Date: Mon, 29 Jul 2024 22:36:43 -0400 Subject: [PATCH] fix: use items sprites in items test instead of pokemon sprites --- pokemon_v2/tests.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pokemon_v2/tests.py b/pokemon_v2/tests.py index 43c99ce2..1400e805 100644 --- a/pokemon_v2/tests.py +++ b/pokemon_v2/tests.py @@ -312,7 +312,7 @@ class APIData: @classmethod def setup_item_sprites_data(cls, item, default=True): - sprite_path = "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/%s.png" + sprite_path = "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/items/%s.png" sprites = { "default": sprite_path % item.id if default else None, @@ -2801,9 +2801,14 @@ class APITests(APIData, APITestCase): "{}{}/evolution-chain/{}/".format(TEST_HOST, API_V2, evolution_chain.pk), ) - sprites_data = json.loads(response.data["sprites"]) + sprites_data = json.loads(item_sprites.sprites) + response_sprites_data = json.loads(response.data["sprites"]) # sprites + self.assertEqual( + sprites_data["default"], + response_sprites_data["default"], + ) self.assertEqual( sprites_data["default"], "{}".format(sprites_data["default"]),