mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-21 19:03:08 +00:00
fix: use items sprites in items test instead of pokemon sprites
This commit is contained in:
parent
554747a707
commit
9841870055
1 changed files with 7 additions and 2 deletions
|
@ -312,7 +312,7 @@ class APIData:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_item_sprites_data(cls, item, default=True):
|
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 = {
|
sprites = {
|
||||||
"default": sprite_path % item.id if default else None,
|
"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),
|
"{}{}/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
|
# sprites
|
||||||
|
self.assertEqual(
|
||||||
|
sprites_data["default"],
|
||||||
|
response_sprites_data["default"],
|
||||||
|
)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
sprites_data["default"],
|
sprites_data["default"],
|
||||||
"{}".format(sprites_data["default"]),
|
"{}".format(sprites_data["default"]),
|
||||||
|
|
Loading…
Reference in a new issue