fix: use items sprites in items test instead of pokemon sprites

This commit is contained in:
gabe 2024-07-29 22:36:43 -04:00
parent 554747a707
commit 9841870055
No known key found for this signature in database

View file

@ -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"]),