Version bumps, removing whitespaces

This commit is contained in:
phalt 2016-03-05 08:26:51 +00:00
parent f6af0441c4
commit 36e8781c68
4 changed files with 90 additions and 93 deletions

View file

@ -13,7 +13,7 @@ http://pokeapi.co
Quite a lot of data is missing from the V1 API.
**As of January 2015, no new data will be added to the v1 API, you will have to use the V2 API instead. This is part of an ongoing deprecation of the v1 API.**
**As of January 2015, no new data will be added to the v1 API, you will have to use the V2 API instead.**
See [This blog post for more information](http://phalt.co/if-you-have-data-they-will-consume-it).

View file

@ -37,7 +37,7 @@ class BerryFlavorSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = BerryFlavor
fields = ('name', 'url')
class BerrySummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
@ -181,7 +181,7 @@ class MoveDamageClassSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = MoveDamageClass
fields = ('name', 'url')
class MoveMetaAilmentSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
@ -193,13 +193,13 @@ class MoveMetaCategorySummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = MoveMetaCategory
fields = ('name', 'url')
class MoveTargetSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = MoveTarget
fields = ('name', 'url')
class MoveSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
@ -237,37 +237,37 @@ class PokedexSummarySerializer(serializers.HyperlinkedModelSerializer):
fields = ('name', 'url')
class PokemonColorSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = PokemonColor
fields = ('name', 'url')
class PokemonHabitatSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = PokemonHabitat
fields = ('name', 'url')
class PokemonShapeSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = PokemonShape
fields = ('name', 'url')
class PokemonSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Pokemon
fields = ('name', 'url')
class PokemonSpeciesSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
class Meta:
model = PokemonSpecies
fields = ('name', 'url')
class PokemonFormSummarySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = PokemonForm
fields = ('name', 'url')
@ -353,7 +353,7 @@ class PokemonAbilitySerializer(serializers.ModelSerializer):
pokemon = PokemonSummarySerializer()
ability = AbilitySummarySerializer()
class Meta:
model = PokemonAbility
fields = ('is_hidden', 'slot', 'ability', 'pokemon')
@ -362,7 +362,7 @@ class PokemonDexEntrySerializer(serializers.ModelSerializer):
entry_number = serializers.IntegerField(source="pokedex_number")
pokedex = PokedexSummarySerializer()
class Meta:
model = PokemonDexNumber
fields = ('entry_number', 'pokedex')
@ -826,7 +826,7 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer):
encounter_method_rates = serializers.SerializerMethodField('get_method_rates')
pokemon_encounters = serializers.SerializerMethodField('get_encounters')
names = LocationAreaNameSerializer(many=True, read_only=True, source='locationareaname')
class Meta:
model = LocationArea
fields = ('id', 'name', 'game_index', 'encounter_method_rates', 'location', 'names', 'pokemon_encounters')
@ -889,7 +889,6 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer):
# each pokemon has multiple versions it could be encountered in
for ver in poke_encounters.values('version').distinct():
version_detail = OrderedDict()
version_detail['version'] = version_data[ver['version'] - 1]
version_detail['max_chance'] = 0
@ -917,7 +916,7 @@ class LocationAreaDetailSerializer(serializers.ModelSerializer):
encounters_list.append(pokemon_detail)
return encounters_list
class LocationGameIndexSerializer(serializers.ModelSerializer):
@ -1014,7 +1013,7 @@ class AbilityDetailSerializer(serializers.ModelSerializer):
class Meta:
model = Ability
fields = (
'id',
'id',
'name',
'is_main_series',
'generation',
@ -1298,7 +1297,7 @@ class ItemDetailSerializer(serializers.ModelSerializer):
for key, val in sprites_data.iteritems():
if sprites_data[key]:
sprites_data[key] = 'http://' + host + sprites_data[key]
sprites_data[key] = 'http://' + host + sprites_data[key]
return sprites_data
@ -1647,7 +1646,7 @@ class MachineDetailSerializer(serializers.ModelSerializer):
item = ItemSummarySerializer()
version_group = VersionSummarySerializer()
move = MoveSummarySerializer()
class Meta:
model = Machine
fields = ('id', 'item', 'version_group', 'move')
@ -1670,7 +1669,7 @@ class MoveBattleStyleNameSerializer(serializers.ModelSerializer):
class MoveBattleStyleDetailSerializer(serializers.ModelSerializer):
names = MoveBattleStyleNameSerializer(many=True, read_only=True, source="movebattlestylename")
class Meta:
model = MoveBattleStyle
fields = ('id', 'name', 'names')
@ -1798,7 +1797,7 @@ class MoveMetaSerializer(serializers.ModelSerializer):
'flinch_chance',
'stat_chance'
)
#############################
@ -1872,7 +1871,7 @@ class MoveEffectEffectTextSerializer(serializers.ModelSerializer):
language = LanguageSummarySerializer()
class Meta:
model = MoveEffectEffectText
model = MoveEffectEffectText
fields = ('effect', 'short_effect', 'language')
@ -1881,7 +1880,7 @@ class MoveEffectChangeEffectTextSerializer(serializers.ModelSerializer):
language = LanguageSummarySerializer()
class Meta:
model = MoveEffectChangeEffectText
model = MoveEffectChangeEffectText
fields = ('effect', 'language')
@ -1916,11 +1915,11 @@ class MoveDetailSerializer(serializers.ModelSerializer):
class Meta:
model = Move
fields = (
'id',
'id',
'name',
'accuracy',
'effect_chance',
'pp',
'pp',
'priority',
'power',
'contest_combos',
@ -2006,7 +2005,7 @@ class MoveDetailSerializer(serializers.ModelSerializer):
for change in stat_changes:
del change['move']
return stat_changes
@ -2018,7 +2017,7 @@ class PalParkSerializer(serializers.ModelSerializer):
area = PalParkAreaSummarySerializer(read_only=True, source="pal_park_area")
pokemon_species = PokemonSpeciesSummarySerializer()
class Meta:
model = PalPark
fields = ('base_score', 'rate', 'area', 'pokemon_species')
@ -2037,7 +2036,7 @@ class PalParkAreaDetailSerializer(serializers.ModelSerializer):
names = PalParkAreaNameSerializer(many=True, read_only=True, source="palparkareaname")
pokemon_encounters = serializers.SerializerMethodField('get_encounters')
class Meta:
model = PalParkArea
fields = ('id', 'name', 'names', 'pokemon_encounters')
@ -2072,7 +2071,7 @@ class PokemonColorDetailSerializer(serializers.ModelSerializer):
names = PokemonColorNameSerializer(many=True, read_only=True, source="pokemoncolorname")
pokemon_species = PokemonSpeciesSummarySerializer(many=True, read_only=True, source="pokemonspecies")
class Meta:
model = PokemonColor
fields = ('id', 'name', 'names', 'pokemon_species')
@ -2095,7 +2094,7 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer):
pokemon = PokemonSummarySerializer()
version_group = VersionGroupSummarySerializer()
sprites = serializers.SerializerMethodField('get_pokemon_form_sprites')
class Meta:
model = PokemonForm
fields = ('id', 'name', 'order', 'form_order', 'is_default', 'is_battle_only', 'is_mega', 'form_name', 'pokemon', 'sprites', 'version_group')
@ -2110,7 +2109,7 @@ class PokemonFormDetailSerializer(serializers.ModelSerializer):
for key, val in sprites_data.iteritems():
if sprites_data[key]:
sprites_data[key] = 'http://' + host + sprites_data[key]
sprites_data[key] = 'http://' + host + sprites_data[key]
return sprites_data
@ -2132,7 +2131,7 @@ class PokemonHabitatDetailSerializer(serializers.ModelSerializer):
names = PokemonHabitatNameSerializer(many=True, read_only=True, source="pokemonhabitatname")
pokemon_species = PokemonSpeciesSummarySerializer(many=True, read_only=True, source='pokemonspecies')
class Meta:
model = PokemonHabitat
fields = ('id', 'name', 'names', 'pokemon_species')
@ -2183,7 +2182,7 @@ class MoveLearnMethodDetailSerializer(serializers.ModelSerializer):
class PokemonMoveSerializer(serializers.ModelSerializer):
class Meta:
model = PokemonMove
@ -2207,7 +2206,7 @@ class PokemonShapeDetailSerializer(serializers.ModelSerializer):
names = serializers.SerializerMethodField('get_shape_names')
awesome_names = serializers.SerializerMethodField('get_shape_awesome_names')
pokemon_species = PokemonSpeciesSummarySerializer(many=True, read_only=True, source='pokemonspecies')
class Meta:
model = PokemonShape
fields = ('id', 'name', 'awesome_names', 'names', 'pokemon_species')
@ -2283,7 +2282,7 @@ class PokemonSpritesSerializer(serializers.ModelSerializer):
fields = ('sprites',)
class PokemonDetailSerializer(serializers.ModelSerializer):
abilities = serializers.SerializerMethodField('get_pokemon_abilities')
game_indices = PokemonGameIndexSerializer(many=True, read_only=True, source="pokemongameindex")
moves = serializers.SerializerMethodField('get_pokemon_moves')
@ -2302,7 +2301,7 @@ class PokemonDetailSerializer(serializers.ModelSerializer):
'name',
'base_experience',
'height',
'is_default',
'is_default',
'order',
'weight',
'abilities',
@ -2326,10 +2325,10 @@ class PokemonDetailSerializer(serializers.ModelSerializer):
for key, val in sprites_data.iteritems():
if sprites_data[key]:
sprites_data[key] = 'http://' + host + sprites_data[key]
sprites_data[key] = 'http://' + host + sprites_data[key]
return sprites_data
def get_pokemon_moves(self, obj):
@ -2553,7 +2552,7 @@ class PokemonSpeciesEvolutionSerializer(serializers.ModelSerializer):
This is here purely to help build pokemon evolution chains
"""
class Meta:
class Meta:
model = PokemonSpecies
fields = ('name', 'id', 'evolves_from_species', 'is_baby')
@ -2576,7 +2575,7 @@ class PokemonSpeciesDetailSerializer(serializers.ModelSerializer):
evolution_chain = EvolutionChainSummarySerializer()
pal_park_encounters = serializers.SerializerMethodField('get_encounters')
class Meta:
class Meta:
model = PokemonSpecies
fields = (
'id',
@ -2740,9 +2739,10 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer):
if species['evolves_from_species']:
# In case this pokemon is one of multiple evolutions a pokemon can make
if previous_species['id'] == species['evolves_from_species']:
current_evolutions = previous_entry['evolves_to']
if previous_species:
if previous_species['id'] == species['evolves_from_species']:
current_evolutions = previous_entry['evolves_to']
entry = OrderedDict()
many=False
@ -2751,7 +2751,7 @@ class EvolutionChainDetailSerializer(serializers.ModelSerializer):
except PokemonEvolution.MultipleObjectsReturned:
evolution_object = PokemonEvolution.objects.filter(evolved_species=species['id'])
many=True
evolution_data = PokemonEvolutionSerializer(evolution_object, many=many, context=self.context).data
current_evolutions.append(entry)
@ -2773,7 +2773,7 @@ class PokemonDexNumberSerializer(serializers.ModelSerializer):
entry_number = serializers.IntegerField(source="pokedex_number")
pokemon_species = PokemonSpeciesSummarySerializer()
class Meta:
model = PokemonDexNumber
fields = ('pokedex', 'entry_number', 'pokemon_species')

View file

@ -1409,7 +1409,7 @@ class APIData():
@classmethod
def setup_nature_data(self, decreased_stat=None, increased_stat=None, likes_flavor=None, hates_flavor=None, name='ntr', game_index=1):
nature = Nature.objects.create (
name = name,
decreased_stat = decreased_stat,
@ -1439,7 +1439,7 @@ class APIData():
@classmethod
def setup_nature_pokeathlon_stat_data(self, nature=None, pokeathlon_stat=None, max_change=1):
nature_pokeathlon_stat = NaturePokeathlonStat.objects.create (
nature = nature,
pokeathlon_stat = pokeathlon_stat,
@ -1451,7 +1451,7 @@ class APIData():
@classmethod
def setup_nature_battle_style_preference_data(self, nature=None, move_battle_style=None, low_hp_preference=10, high_hp_preference=20):
nature_battle_style_preference = NatureBattleStylePreference.objects.create (
nature = nature,
move_battle_style = move_battle_style,
@ -1462,7 +1462,7 @@ class APIData():
return nature_battle_style_preference
"""
Pokedex Data
@ -1719,7 +1719,7 @@ class APIData():
pokemon_egg_group.save()
return pokemon_egg_group
@classmethod
def setup_pokemon_data(self, pokemon_species=None, name='pkmn', height=100, weight=100, base_experience=0, order=1, is_default=False):
@ -1756,7 +1756,7 @@ class APIData():
@classmethod
def setup_pokemon_form_sprites_data(
self, pokemon_form,
self, pokemon_form,
front_default=True, front_shiny=False,
back_default=False, back_shiny=False):
@ -2191,7 +2191,7 @@ class APIData():
"""
"""
Tests
"""
@ -2221,7 +2221,7 @@ class APITests(APIData, APITestCase):
self.assertEqual(response.data['pokemon_species_details'][0]['pokemon_species']['url'], '{}{}/pokemon-species/{}/'.format(test_host, api_v2, pokemon_species.pk))
self.assertEqual(response.data['required_for_evolution'][0]['name'], evolved_species.name)
self.assertEqual(response.data['required_for_evolution'][0]['url'], '{}{}/pokemon-species/{}/'.format(test_host, api_v2, evolved_species.pk))
"""
Language Tests
@ -2285,8 +2285,8 @@ class APITests(APIData, APITestCase):
# version group params
self.assertEqual(response.data['version_groups'][0]['name'], version_group.name)
self.assertEqual(response.data['version_groups'][0]['url'], '{}{}/version-group/{}/'.format(test_host, api_v2, version_group.pk))
"""
Generation Tests
@ -2387,7 +2387,7 @@ class APITests(APIData, APITestCase):
# pokedex group
self.assertEqual(response.data['pokedexes'][0]['name'], pokedex.name)
self.assertEqual(response.data['pokedexes'][0]['url'], '{}{}/pokedex/{}/'.format(test_host, api_v2, pokedex.pk))
"""
@ -2414,7 +2414,7 @@ class APITests(APIData, APITestCase):
self.assertEqual(response.data['names'][0]['language']['url'], '{}{}/language/{}/'.format(test_host, api_v2, egg_group_name.language.pk))
# species params
self.assertEqual(response.data['pokemon_species'][0]['name'], pokemon_species.name)
self.assertEqual(response.data['pokemon_species'][0]['url'], '{}{}/pokemon-species/{}/'.format(test_host, api_v2, pokemon_species.pk))
self.assertEqual(response.data['pokemon_species'][0]['url'], '{}{}/pokemon-species/{}/'.format(test_host, api_v2, pokemon_species.pk))
@ -2434,7 +2434,7 @@ class APITests(APIData, APITestCase):
pokemon_ability = self.setup_pokemon_ability_data(ability=ability, pokemon=pokemon)
response = self.client.get('{}/ability/{}/'.format(api_v2, ability.pk))
# base params
self.assertEqual(response.data['id'], ability.pk)
self.assertEqual(response.data['name'], ability.name)
@ -2467,7 +2467,7 @@ class APITests(APIData, APITestCase):
self.assertEqual(response.data['pokemon'][0]['slot'], pokemon_ability.slot)
self.assertEqual(response.data['pokemon'][0]['pokemon']['name'], pokemon.name)
self.assertEqual(response.data['pokemon'][0]['pokemon']['url'], '{}{}/pokemon/{}/'.format(test_host, api_v2, pokemon.pk))
"""
@ -2588,7 +2588,7 @@ class APITests(APIData, APITestCase):
sprites_data = json.loads(item_sprites.sprites)
response = self.client.get('{}/item/{}/'.format(api_v2, item.pk), HTTP_HOST='testserver')
# base params
self.assertEqual(response.data['id'], item.pk)
self.assertEqual(response.data['name'], item.name)
@ -2690,7 +2690,7 @@ class APITests(APIData, APITestCase):
berry = self.setup_berry_data(name='base bry', natural_gift_type=type)
berry_flavor = self.setup_berry_flavor_data(name='bry flvr for base bry')
berry_flavor_map = self.setup_berry_flavor_map_data(berry=berry, berry_flavor=berry_flavor)
response = self.client.get('{}/berry/{}/'.format(api_v2, berry.pk))
# base params
@ -2715,7 +2715,7 @@ class APITests(APIData, APITestCase):
# natural gift type
self.assertEqual(response.data['natural_gift_type']['name'], type.name)
self.assertEqual(response.data['natural_gift_type']['url'], '{}{}/type/{}/'.format(test_host, api_v2, type.pk))
"""
@ -2753,7 +2753,7 @@ class APITests(APIData, APITestCase):
# species params
self.assertEqual(response.data['pokemon_species'][0]['name'], pokemon_species.name)
self.assertEqual(response.data['pokemon_species'][0]['url'], '{}{}/pokemon-species/{}/'.format(test_host, api_v2, pokemon_species.pk))
"""
@ -2894,7 +2894,7 @@ class APITests(APIData, APITestCase):
self.assertEqual(response.data['flavor_text_entries'][0]['flavor_text'], contest_effect_flavor_text.flavor_text)
self.assertEqual(response.data['flavor_text_entries'][0]['language']['name'], contest_effect_flavor_text.language.name)
self.assertEqual(response.data['flavor_text_entries'][0]['language']['url'], '{}{}/language/{}/'.format(test_host, api_v2, contest_effect_flavor_text.language.pk))
def test_super_contest_effect_api(self):
@ -2916,8 +2916,8 @@ class APITests(APIData, APITestCase):
# move params
self.assertEqual(response.data['moves'][0]['name'], move.name)
self.assertEqual(response.data['moves'][0]['url'], '{}{}/move/{}/'.format(test_host, api_v2, move.pk))
"""
Type Tests
@ -3060,7 +3060,7 @@ class APITests(APIData, APITestCase):
self.assertEqual(response.data['pokemon_entries'][0]['entry_number'], dex_entry.pokedex_number)
self.assertEqual(response.data['pokemon_entries'][0]['pokemon_species']['name'], pokemon_species.name)
self.assertEqual(response.data['pokemon_entries'][0]['pokemon_species']['url'], '{}{}/pokemon-species/{}/'.format(test_host, api_v2, pokemon_species.pk))
"""
Move Tests
@ -3315,8 +3315,8 @@ class APITests(APIData, APITestCase):
self.assertEqual(response.data['effect_changes'][0]['effect_entries'][0]['effect'], move_effect_change_effect_text.effect)
self.assertEqual(response.data['effect_changes'][0]['effect_entries'][0]['language']['name'], move_effect_change_effect_text.language.name)
self.assertEqual(response.data['effect_changes'][0]['effect_entries'][0]['language']['url'], '{}{}/language/{}/'.format(test_host, api_v2, move_effect_change_effect_text.language.pk))
"""
Stat Tests
@ -3364,7 +3364,7 @@ class APITests(APIData, APITestCase):
self.assertEqual(response.data['affecting_moves']['decrease'][0]['move']['url'], '{}{}/move/{}/'.format(test_host, api_v2, decrease_move.pk))
# characteristics params
self.assertEqual(response.data['characteristics'][0]['url'], '{}{}/characteristic/{}/'.format(test_host, api_v2, characteristic.pk))
def test_pokeathlon_stat_api(self):
@ -3382,7 +3382,7 @@ class APITests(APIData, APITestCase):
self.assertEqual(response.data['names'][0]['name'], pokeathlon_stat_name.name)
self.assertEqual(response.data['names'][0]['language']['name'], pokeathlon_stat_name.language.name)
self.assertEqual(response.data['names'][0]['language']['url'], '{}{}/language/{}/'.format(test_host, api_v2, pokeathlon_stat_name.language.pk))
"""
Characteristic Tests
@ -3422,7 +3422,7 @@ class APITests(APIData, APITestCase):
increased_stat = self.setup_stat_data(name='ncrs stt for base ntr')
nature = self.setup_nature_data(name='base ntr', hates_flavor=hates_flavor, likes_flavor=likes_flavor, decreased_stat=decreased_stat, increased_stat=increased_stat)
nature_name = self.setup_nature_name_data(nature, name='base ntr name')
pokeathlon_stat = self.setup_pokeathlon_stat_data(name='pkeathln stt for ntr stt')
nature_pokeathlon_stat = self.setup_nature_pokeathlon_stat_data(nature=nature, pokeathlon_stat=pokeathlon_stat, max_change=1)
@ -3486,7 +3486,7 @@ class APITests(APIData, APITestCase):
# species params
self.assertEqual(response.data['pokemon_species'][0]['name'], pokemon_species.name)
self.assertEqual(response.data['pokemon_species'][0]['url'], '{}{}/pokemon-species/{}/'.format(test_host, api_v2, pokemon_species.pk))
def test_pokemon_color_api(self):
@ -3508,7 +3508,7 @@ class APITests(APIData, APITestCase):
# species params
self.assertEqual(response.data['pokemon_species'][0]['name'], pokemon_species.name)
self.assertEqual(response.data['pokemon_species'][0]['url'], '{}{}/pokemon-species/{}/'.format(test_host, api_v2, pokemon_species.pk))
def test_pokemon_shape_api(self):
@ -3534,7 +3534,7 @@ class APITests(APIData, APITestCase):
# species params
self.assertEqual(response.data['pokemon_species'][0]['name'], pokemon_species.name)
self.assertEqual(response.data['pokemon_species'][0]['url'], '{}{}/pokemon-species/{}/'.format(test_host, api_v2, pokemon_species.pk))
def test_pokemon_species_api(self):
@ -3544,11 +3544,11 @@ class APITests(APIData, APITestCase):
pokemon_species_form_description = self.setup_pokemon_species_form_description_data(pokemon_species, description='frm dscr for pkmn spcs')
pokemon_species_flavor_text = self.setup_pokemon_species_flavor_text_data(pokemon_species, flavor_text='flvr txt for pkmn spcs')
pokedex = self.setup_pokedex_data(name='pkdx for pkmn spcs')
pal_park = self.setup_pal_park_data(pokemon_species=pokemon_species)
dex_number = self.setup_pokemon_dex_entry_data(pokemon_species=pokemon_species, pokedex=pokedex, entry_number=44)
egg_group = self.setup_egg_group_data(name='egg grp for pkmn spcs')
self.setup_pokemon_egg_group_data(pokemon_species=pokemon_species, egg_group=egg_group)
@ -3622,7 +3622,7 @@ class APITests(APIData, APITestCase):
self.assertEqual(response.data['pal_park_encounters'][0]['rate'], pal_park.rate)
self.assertEqual(response.data['pal_park_encounters'][0]['area']['name'], pal_park.pal_park_area.name)
self.assertEqual(response.data['pal_park_encounters'][0]['area']['url'], '{}{}/pal-park-area/{}/'.format(test_host, api_v2, pal_park.pal_park_area.pk))
def test_pokemon_api(self):
@ -3649,7 +3649,7 @@ class APITests(APIData, APITestCase):
version_group=version_group,
level=move)
pokemon_moves.append(new_move)
encounter_method = self.setup_encounter_method_data(name='encntr mthd for lctn area')
location_area1 = self.setup_location_area_data(name='lctn1 area for base pkmn')
encounter_slot1 = self.setup_encounter_slot_data(encounter_method, slot=1, rarity=30)
@ -3747,10 +3747,10 @@ class APITests(APIData, APITestCase):
# game indices params
self.assertEqual(response.data['game_indices'][0]['game_index'], pokemon_game_index.game_index)
self.assertEqual(response.data['game_indices'][0]['version']['name'], pokemon_game_index.version.name)
self.assertEqual(response.data['game_indices'][0]['version']['url'], '{}{}/version/{}/'.format(test_host, api_v2, pokemon_game_index.version.pk))
self.assertEqual(response.data['game_indices'][0]['version']['url'], '{}{}/version/{}/'.format(test_host, api_v2, pokemon_game_index.version.pk))
# form params
self.assertEqual(response.data['forms'][0]['name'], pokemon_form.name)
self.assertEqual(response.data['forms'][0]['url'], '{}{}/pokemon-form/{}/'.format(test_host, api_v2, pokemon_form.pk))
self.assertEqual(response.data['forms'][0]['url'], '{}{}/pokemon-form/{}/'.format(test_host, api_v2, pokemon_form.pk))
# encounter params
self.assertEqual(response.data['location_area_encounters'][0]['location_area']['name'], location_area1.name)
self.assertEqual(response.data['location_area_encounters'][0]['location_area']['url'], '{}{}/location-area/{}/'.format(test_host, api_v2, location_area1.pk))
@ -3772,7 +3772,7 @@ class APITests(APIData, APITestCase):
# sprite params
self.assertEqual(response.data['sprites']['front_default'], '{}{}'.format(test_host, sprites_data['front_default']))
self.assertEqual(response.data['sprites']['back_default'], None)
def test_pokemon_form_api(self):
@ -3832,7 +3832,7 @@ class APITests(APIData, APITestCase):
# pokemon species params
self.assertEqual(response.data['pokemon_species'][0]['name'], pokemon_species.name)
self.assertEqual(response.data['pokemon_species'][0]['url'], '{}{}/pokemon-species/{}/'.format(test_host, api_v2, pokemon_species.pk))
def test_evolution_chain_api(self):
@ -3950,7 +3950,7 @@ class APITests(APIData, APITestCase):
# condition params
self.assertEqual(response.data['condition']['name'], encounter_condition.name)
self.assertEqual(response.data['condition']['url'], '{}{}/encounter-condition/{}/'.format(test_host, api_v2, encounter_condition.pk))
def test_encounter_condition_api(self):
@ -3972,7 +3972,7 @@ class APITests(APIData, APITestCase):
# value params
self.assertEqual(response.data['values'][0]['name'], encounter_condition_value.name)
self.assertEqual(response.data['values'][0]['url'], '{}{}/encounter-condition-value/{}/'.format(test_host, api_v2, encounter_condition_value.pk))
"""
Pal Park Tests
@ -4001,5 +4001,3 @@ class APITests(APIData, APITestCase):
self.assertEqual(response.data['pokemon_encounters'][0]['rate'], pal_park.rate)
self.assertEqual(response.data['pokemon_encounters'][0]['pokemon_species']['name'], pokemon_species.name)
self.assertEqual(response.data['pokemon_encounters'][0]['pokemon_species']['url'], '{}{}/pokemon-species/{}/'.format(test_host, api_v2, pokemon_species.pk))

View file

@ -1,13 +1,12 @@
Django==1.7.1
Django==1.8.10
Pillow==2.6.1
South==1.0
Unipath==1.0
coverage==3.6
django-appconf==0.6
django-cors-headers==1.0.0
django-discover-runner==0.4
django-imagekit==3.2.4
django-tastypie==0.12.1
django-tastypie==0.13.3
django-markdown-deux==1.0.5
djangorestframework>=3.1.0
gunicorn==0.17.0