Fix line lengths for pylint

This commit is contained in:
Julian Lawrance 2019-11-30 23:42:46 +00:00
parent 999e2d1bb9
commit 7a2e0c4f41
2 changed files with 19 additions and 7 deletions

View file

@ -2649,7 +2649,11 @@ class PokemonDetailSerializer(serializers.ModelSerializer):
def get_past_pokemon_types(self, obj):
poke_past_type_objects = PokemonTypePast.objects.filter(pokemon=obj)
poke_past_types = PokemonTypePastSerializer(poke_past_type_objects, many=True, context=self.context).data
poke_past_types = PokemonTypePastSerializer(
poke_past_type_objects,
many=True,
context=self.context
).data
# post-process to the form we want
current_generation = ""

View file

@ -4112,7 +4112,10 @@ class APITests(APIData, APITestCase):
pokemon_stat = self.setup_pokemon_stat_data(pokemon=pokemon)
pokemon_type = self.setup_pokemon_type_data(pokemon=pokemon)
generation = self.setup_generation_data(name='base gen')
pokemon_past_type = self.setup_pokemon_past_type_data(pokemon=pokemon, generation=generation)
pokemon_past_type = self.setup_pokemon_past_type_data(
pokemon=pokemon,
generation=generation
)
pokemon_item = self.setup_pokemon_item_data(pokemon=pokemon)
pokemon_sprites = self.setup_pokemon_sprites_data(pokemon=pokemon)
pokemon_game_index = self.setup_pokemon_game_index_data(pokemon=pokemon, game_index=10)
@ -4183,16 +4186,21 @@ class APITests(APIData, APITestCase):
self.assertEqual(
response.data['types'][0]['type']['url'],
'{}{}/type/{}/'.format(TEST_HOST, API_V2, pokemon_type.type.pk))
# past type params
self.assertEqual(response.data['past_types'][0]['generation']['name'], pokemon_past_type.generation.name)
past_types_obj = response.data['past_types'][0]
self.assertEqual(past_types_obj['generation']['name'], pokemon_past_type.generation.name)
self.assertEqual(
response.data['past_types'][0]['generation']['url'],
past_types_obj['generation']['url'],
'{}{}/generation/{}/'.format(TEST_HOST, API_V2, pokemon_past_type.generation.pk))
self.assertEqual(response.data['past_types'][0]['types'][0]['slot'], pokemon_past_type.slot)
self.assertEqual(response.data['past_types'][0]['types'][0]['type']['name'], pokemon_past_type.type.name)
past_types_types_obj = past_types_obj['types'][0]
self.assertEqual(past_types_types_obj['slot'], pokemon_past_type.slot)
self.assertEqual(past_types_types_obj['type']['name'], pokemon_past_type.type.name)
self.assertEqual(
response.data['past_types'][0]['types'][0]['type']['url'],
past_types_types_obj['type']['url'],
'{}{}/type/{}/'.format(TEST_HOST, API_V2, pokemon_past_type.type.pk))
# items params
self.assertEqual(response.data['held_items'][0]['item']['name'], pokemon_item.item.name)
self.assertEqual(