@@ -1703,7 +1703,7 @@ def setup_pokemon_past_ability_data(
17031703 cls , pokemon , generation , ability = None , is_hidden = False , slot = 1
17041704 ):
17051705
1706- type = type or cls .setup_ability_data (name = "ablty for pkmn" )
1706+ ability = ability or cls .setup_ability_data (name = "ablty for pkmn" )
17071707
17081708 pokemon_ability_past = PokemonAbilityPast (
17091709 pokemon = pokemon ,
@@ -4958,10 +4958,13 @@ def test_pokemon_api(self):
49584958 pokemon_form = self .setup_pokemon_form_data (
49594959 pokemon = pokemon , name = "pkm form for base pkmn"
49604960 )
4961+ generation = self .setup_generation_data (name = "base gen" )
49614962 pokemon_ability = self .setup_pokemon_ability_data (pokemon = pokemon )
4963+ pokemon_past_ability = self .setup_pokemon_past_ability_data (
4964+ pokemon = pokemon , generation = generation
4965+ )
49624966 pokemon_stat = self .setup_pokemon_stat_data (pokemon = pokemon )
49634967 pokemon_type = self .setup_pokemon_type_data (pokemon = pokemon )
4964- generation = self .setup_generation_data (name = "base gen" )
49654968 pokemon_past_type = self .setup_pokemon_past_type_data (
49664969 pokemon = pokemon , generation = generation
49674970 )
@@ -5047,6 +5050,36 @@ def test_pokemon_api(self):
50475050 response .data ["abilities" ][0 ]["ability" ]["url" ],
50485051 "{}{}/ability/{}/" .format (TEST_HOST , API_V2 , pokemon_ability .ability .pk ),
50495052 )
5053+ # past abilities params
5054+ past_abilities_obj = response .data ["past_abilities" ][0 ]
5055+ self .assertEqual (
5056+ past_abilities_obj ["generation" ]["name" ],
5057+ pokemon_past_ability .generation .name ,
5058+ )
5059+ self .assertEqual (
5060+ past_abilities_obj ["generation" ]["url" ],
5061+ "{}{}/generation/{}/" .format (
5062+ TEST_HOST , API_V2 , pokemon_past_ability .generation .pk
5063+ ),
5064+ )
5065+
5066+ past_abilities_abilities_obj = past_abilities_obj ["abilities" ][0 ]
5067+ self .assertEqual (
5068+ past_abilities_abilities_obj ["is_hidden" ], pokemon_past_ability .is_hidden
5069+ )
5070+ self .assertEqual (
5071+ past_abilities_abilities_obj ["slot" ], pokemon_past_ability .slot
5072+ )
5073+ self .assertEqual (
5074+ past_abilities_abilities_obj ["ability" ]["name" ],
5075+ pokemon_past_ability .ability .name ,
5076+ )
5077+ self .assertEqual (
5078+ past_abilities_abilities_obj ["ability" ]["url" ],
5079+ "{}{}/ability/{}/" .format (
5080+ TEST_HOST , API_V2 , pokemon_past_ability .ability .pk
5081+ ),
5082+ )
50505083 # stat params
50515084 self .assertEqual (response .data ["stats" ][0 ]["base_stat" ], pokemon_stat .base_stat )
50525085 self .assertEqual (response .data ["stats" ][0 ]["effort" ], pokemon_stat .effort )
0 commit comments