mirror of
https://github.com/PokeAPI/pokeapi
synced 2024-11-28 22:30:25 +00:00
fix: run black
This commit is contained in:
parent
71d75c3540
commit
464aeea4af
8 changed files with 557 additions and 184 deletions
|
@ -17,7 +17,9 @@ CACHES = {
|
||||||
"default": {
|
"default": {
|
||||||
"BACKEND": "django_redis.cache.RedisCache",
|
"BACKEND": "django_redis.cache.RedisCache",
|
||||||
"LOCATION": "redis://cache:6379/1",
|
"LOCATION": "redis://cache:6379/1",
|
||||||
"OPTIONS": {"CLIENT_CLASS": "django_redis.client.DefaultClient",},
|
"OPTIONS": {
|
||||||
|
"CLIENT_CLASS": "django_redis.client.DefaultClient",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,9 @@ CACHES = {
|
||||||
"default": {
|
"default": {
|
||||||
"BACKEND": "django_redis.cache.RedisCache",
|
"BACKEND": "django_redis.cache.RedisCache",
|
||||||
"LOCATION": "redis://127.0.0.1:6379/1",
|
"LOCATION": "redis://127.0.0.1:6379/1",
|
||||||
"OPTIONS": {"CLIENT_CLASS": "django_redis.client.DefaultClient",},
|
"OPTIONS": {
|
||||||
|
"CLIENT_CLASS": "django_redis.client.DefaultClient",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,11 @@ DATABASES = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CACHES = {"default": {"BACKEND": "django.core.cache.backends.dummy.DummyCache",}}
|
CACHES = {
|
||||||
|
"default": {
|
||||||
|
"BACKEND": "django.core.cache.backends.dummy.DummyCache",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
TASTYPIE_FULL_DEBUG = True
|
TASTYPIE_FULL_DEBUG = True
|
||||||
|
|
|
@ -72,7 +72,9 @@ CACHES = {
|
||||||
"default": {
|
"default": {
|
||||||
"BACKEND": "django_redis.cache.RedisCache",
|
"BACKEND": "django_redis.cache.RedisCache",
|
||||||
"LOCATION": "redis://127.0.0.1:6379/1",
|
"LOCATION": "redis://127.0.0.1:6379/1",
|
||||||
"OPTIONS": {"CLIENT_CLASS": "django_redis.client.DefaultClient",},
|
"OPTIONS": {
|
||||||
|
"CLIENT_CLASS": "django_redis.client.DefaultClient",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -32,7 +32,9 @@ class Migration(migrations.Migration):
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
options={"abstract": False,},
|
options={
|
||||||
|
"abstract": False,
|
||||||
|
},
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name="PokemonFormSprites",
|
name="PokemonFormSprites",
|
||||||
|
@ -58,7 +60,9 @@ class Migration(migrations.Migration):
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
options={"abstract": False,},
|
options={
|
||||||
|
"abstract": False,
|
||||||
|
},
|
||||||
),
|
),
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name="PokemonSprites",
|
name="PokemonSprites",
|
||||||
|
@ -84,6 +88,8 @@ class Migration(migrations.Migration):
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
options={"abstract": False,},
|
options={
|
||||||
|
"abstract": False,
|
||||||
|
},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -6,13 +6,13 @@ from django.db import migrations, models
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('pokemon_v2', '0007_auto_20200815_0610'),
|
("pokemon_v2", "0007_auto_20200815_0610"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='pokemonformname',
|
model_name="pokemonformname",
|
||||||
name='pokemon_name',
|
name="pokemon_name",
|
||||||
field=models.CharField(max_length=60),
|
field=models.CharField(max_length=60),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -17,7 +17,9 @@ class APIData:
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_gender_data(cls, name="gndr"):
|
def setup_gender_data(cls, name="gndr"):
|
||||||
|
|
||||||
gender = Gender.objects.create(name=name,)
|
gender = Gender.objects.create(
|
||||||
|
name=name,
|
||||||
|
)
|
||||||
gender.save()
|
gender.save()
|
||||||
|
|
||||||
return gender
|
return gender
|
||||||
|
@ -27,7 +29,11 @@ class APIData:
|
||||||
def setup_language_data(cls, name="lang"):
|
def setup_language_data(cls, name="lang"):
|
||||||
|
|
||||||
language = Language.objects.create(
|
language = Language.objects.create(
|
||||||
iso639="ts", iso3166="tt", name=name, official=True, order=1,
|
iso639="ts",
|
||||||
|
iso3166="tt",
|
||||||
|
name=name,
|
||||||
|
official=True,
|
||||||
|
order=1,
|
||||||
)
|
)
|
||||||
language.save()
|
language.save()
|
||||||
|
|
||||||
|
@ -115,7 +121,10 @@ class APIData:
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_version_data(cls, version_group=None, name="ver"):
|
def setup_version_data(cls, version_group=None, name="ver"):
|
||||||
|
|
||||||
version = Version.objects.create(name=name, version_group=version_group,)
|
version = Version.objects.create(
|
||||||
|
name=name,
|
||||||
|
version_group=version_group,
|
||||||
|
)
|
||||||
version.save()
|
version.save()
|
||||||
|
|
||||||
return version
|
return version
|
||||||
|
@ -218,7 +227,9 @@ class APIData:
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_item_attribute_data(cls, name="itm attr"):
|
def setup_item_attribute_data(cls, name="itm attr"):
|
||||||
|
|
||||||
item_attribute = ItemAttribute.objects.create(name=name,)
|
item_attribute = ItemAttribute.objects.create(
|
||||||
|
name=name,
|
||||||
|
)
|
||||||
item_attribute.save()
|
item_attribute.save()
|
||||||
|
|
||||||
return item_attribute
|
return item_attribute
|
||||||
|
@ -260,7 +271,9 @@ class APIData:
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_item_fling_effect_data(cls, name="itm flng efct"):
|
def setup_item_fling_effect_data(cls, name="itm flng efct"):
|
||||||
|
|
||||||
item_fling_effect = ItemFlingEffect.objects.create(name=name,)
|
item_fling_effect = ItemFlingEffect.objects.create(
|
||||||
|
name=name,
|
||||||
|
)
|
||||||
item_fling_effect.save()
|
item_fling_effect.save()
|
||||||
|
|
||||||
return item_fling_effect
|
return item_fling_effect
|
||||||
|
@ -282,7 +295,9 @@ class APIData:
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_item_pocket_data(cls, name="itm pkt"):
|
def setup_item_pocket_data(cls, name="itm pkt"):
|
||||||
|
|
||||||
item_pocket = ItemPocket.objects.create(name=name,)
|
item_pocket = ItemPocket.objects.create(
|
||||||
|
name=name,
|
||||||
|
)
|
||||||
item_pocket.save()
|
item_pocket.save()
|
||||||
|
|
||||||
return item_pocket
|
return item_pocket
|
||||||
|
@ -417,7 +432,9 @@ class APIData:
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_contest_type_data(cls, name="cntst tp"):
|
def setup_contest_type_data(cls, name="cntst tp"):
|
||||||
|
|
||||||
contest_type = ContestType.objects.create(name=name,)
|
contest_type = ContestType.objects.create(
|
||||||
|
name=name,
|
||||||
|
)
|
||||||
contest_type.save()
|
contest_type.save()
|
||||||
|
|
||||||
return contest_type
|
return contest_type
|
||||||
|
@ -473,7 +490,9 @@ class APIData:
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_super_contest_effect_data(cls, appeal=2):
|
def setup_super_contest_effect_data(cls, appeal=2):
|
||||||
|
|
||||||
super_contest_effect = SuperContestEffect.objects.create(appeal=appeal,)
|
super_contest_effect = SuperContestEffect.objects.create(
|
||||||
|
appeal=appeal,
|
||||||
|
)
|
||||||
super_contest_effect.save()
|
super_contest_effect.save()
|
||||||
|
|
||||||
return super_contest_effect
|
return super_contest_effect
|
||||||
|
@ -522,7 +541,9 @@ class APIData:
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_berry_firmness_data(cls, name="bry frmns"):
|
def setup_berry_firmness_data(cls, name="bry frmns"):
|
||||||
|
|
||||||
berry_firmness = BerryFirmness.objects.create(name=name,)
|
berry_firmness = BerryFirmness.objects.create(
|
||||||
|
name=name,
|
||||||
|
)
|
||||||
berry_firmness.save()
|
berry_firmness.save()
|
||||||
|
|
||||||
return berry_firmness
|
return berry_firmness
|
||||||
|
@ -590,7 +611,9 @@ class APIData:
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_egg_group_data(cls, name="egg grp"):
|
def setup_egg_group_data(cls, name="egg grp"):
|
||||||
|
|
||||||
egg_group = EggGroup.objects.create(name=name,)
|
egg_group = EggGroup.objects.create(
|
||||||
|
name=name,
|
||||||
|
)
|
||||||
egg_group.save()
|
egg_group.save()
|
||||||
|
|
||||||
return egg_group
|
return egg_group
|
||||||
|
@ -1271,7 +1294,9 @@ class APIData:
|
||||||
):
|
):
|
||||||
|
|
||||||
nature_pokeathlon_stat = NaturePokeathlonStat.objects.create(
|
nature_pokeathlon_stat = NaturePokeathlonStat.objects.create(
|
||||||
nature=nature, pokeathlon_stat=pokeathlon_stat, max_change=max_change,
|
nature=nature,
|
||||||
|
pokeathlon_stat=pokeathlon_stat,
|
||||||
|
max_change=max_change,
|
||||||
)
|
)
|
||||||
nature_pokeathlon_stat.save()
|
nature_pokeathlon_stat.save()
|
||||||
|
|
||||||
|
@ -1302,7 +1327,10 @@ class APIData:
|
||||||
|
|
||||||
region = region or cls.setup_region_data(name="rgn for " + name)
|
region = region or cls.setup_region_data(name="rgn for " + name)
|
||||||
|
|
||||||
pokedex = Pokedex.objects.create(name=name, region=region,)
|
pokedex = Pokedex.objects.create(
|
||||||
|
name=name,
|
||||||
|
region=region,
|
||||||
|
)
|
||||||
pokedex.save()
|
pokedex.save()
|
||||||
|
|
||||||
return pokedex
|
return pokedex
|
||||||
|
@ -1349,7 +1377,9 @@ class APIData:
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_pokemon_habitat_data(cls, name="pkm hbtt"):
|
def setup_pokemon_habitat_data(cls, name="pkm hbtt"):
|
||||||
|
|
||||||
pokemon_habitat = PokemonHabitat.objects.create(name=name,)
|
pokemon_habitat = PokemonHabitat.objects.create(
|
||||||
|
name=name,
|
||||||
|
)
|
||||||
pokemon_habitat.save()
|
pokemon_habitat.save()
|
||||||
|
|
||||||
return pokemon_habitat
|
return pokemon_habitat
|
||||||
|
@ -1369,7 +1399,9 @@ class APIData:
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_pokemon_color_data(cls, name="pkm clr"):
|
def setup_pokemon_color_data(cls, name="pkm clr"):
|
||||||
|
|
||||||
pokemon_color = PokemonColor.objects.create(name=name,)
|
pokemon_color = PokemonColor.objects.create(
|
||||||
|
name=name,
|
||||||
|
)
|
||||||
pokemon_color.save()
|
pokemon_color.save()
|
||||||
|
|
||||||
return pokemon_color
|
return pokemon_color
|
||||||
|
@ -1389,7 +1421,9 @@ class APIData:
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_pokemon_shape_data(cls, name="pkm shp"):
|
def setup_pokemon_shape_data(cls, name="pkm shp"):
|
||||||
|
|
||||||
pokemon_shape = PokemonShape.objects.create(name=name,)
|
pokemon_shape = PokemonShape.objects.create(
|
||||||
|
name=name,
|
||||||
|
)
|
||||||
pokemon_shape.save()
|
pokemon_shape.save()
|
||||||
|
|
||||||
return pokemon_shape
|
return pokemon_shape
|
||||||
|
@ -1753,7 +1787,9 @@ class APIData:
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_evolution_trigger_data(cls, name="evltn trgr"):
|
def setup_evolution_trigger_data(cls, name="evltn trgr"):
|
||||||
|
|
||||||
evolution_trigger = EvolutionTrigger.objects.create(name=name,)
|
evolution_trigger = EvolutionTrigger.objects.create(
|
||||||
|
name=name,
|
||||||
|
)
|
||||||
evolution_trigger.save()
|
evolution_trigger.save()
|
||||||
|
|
||||||
return evolution_trigger
|
return evolution_trigger
|
||||||
|
@ -3312,9 +3348,11 @@ class APITests(APIData, APITestCase):
|
||||||
def test_super_contest_effect_api(self):
|
def test_super_contest_effect_api(self):
|
||||||
|
|
||||||
super_contest_effect = self.setup_super_contest_effect_data(appeal=10)
|
super_contest_effect = self.setup_super_contest_effect_data(appeal=10)
|
||||||
super_contest_effect_flavor_text = self.setup_super_contest_effect_flavor_text_data(
|
super_contest_effect_flavor_text = (
|
||||||
|
self.setup_super_contest_effect_flavor_text_data(
|
||||||
super_contest_effect, flavor_text="base spr cntst efct flvr txt"
|
super_contest_effect, flavor_text="base spr cntst efct flvr txt"
|
||||||
)
|
)
|
||||||
|
)
|
||||||
move = self.setup_move_data(
|
move = self.setup_move_data(
|
||||||
name="mv for base spr cntst efct", super_contest_effect=super_contest_effect
|
name="mv for base spr cntst efct", super_contest_effect=super_contest_effect
|
||||||
)
|
)
|
||||||
|
@ -4523,9 +4561,11 @@ class APITests(APIData, APITestCase):
|
||||||
pokemon_species_name = self.setup_pokemon_species_name_data(
|
pokemon_species_name = self.setup_pokemon_species_name_data(
|
||||||
pokemon_species, name="base pkmn shp name"
|
pokemon_species, name="base pkmn shp name"
|
||||||
)
|
)
|
||||||
pokemon_species_form_description = self.setup_pokemon_species_form_description_data(
|
pokemon_species_form_description = (
|
||||||
|
self.setup_pokemon_species_form_description_data(
|
||||||
pokemon_species, description="frm dscr for pkmn spcs"
|
pokemon_species, description="frm dscr for pkmn spcs"
|
||||||
)
|
)
|
||||||
|
)
|
||||||
pokemon_species_flavor_text = self.setup_pokemon_species_flavor_text_data(
|
pokemon_species_flavor_text = self.setup_pokemon_species_flavor_text_data(
|
||||||
pokemon_species, flavor_text="flvr txt for pkmn spcs"
|
pokemon_species, flavor_text="flvr txt for pkmn spcs"
|
||||||
)
|
)
|
||||||
|
@ -5217,11 +5257,14 @@ class APITests(APIData, APITestCase):
|
||||||
evolution_chain = self.setup_evolution_chain_data()
|
evolution_chain = self.setup_evolution_chain_data()
|
||||||
|
|
||||||
basic = self.setup_pokemon_species_data(
|
basic = self.setup_pokemon_species_data(
|
||||||
name="wurmple", evolution_chain=evolution_chain,
|
name="wurmple",
|
||||||
|
evolution_chain=evolution_chain,
|
||||||
)
|
)
|
||||||
|
|
||||||
stage_one_first = self.setup_pokemon_species_data(
|
stage_one_first = self.setup_pokemon_species_data(
|
||||||
name="silcoon", evolves_from_species=basic, evolution_chain=evolution_chain,
|
name="silcoon",
|
||||||
|
evolves_from_species=basic,
|
||||||
|
evolution_chain=evolution_chain,
|
||||||
)
|
)
|
||||||
stage_one_first_evolution = self.setup_pokemon_evolution_data(
|
stage_one_first_evolution = self.setup_pokemon_evolution_data(
|
||||||
evolved_species=stage_one_first, min_level=7
|
evolved_species=stage_one_first, min_level=7
|
||||||
|
@ -5237,7 +5280,9 @@ class APITests(APIData, APITestCase):
|
||||||
)
|
)
|
||||||
|
|
||||||
stage_one_second = self.setup_pokemon_species_data(
|
stage_one_second = self.setup_pokemon_species_data(
|
||||||
name="cascoon", evolves_from_species=basic, evolution_chain=evolution_chain,
|
name="cascoon",
|
||||||
|
evolves_from_species=basic,
|
||||||
|
evolution_chain=evolution_chain,
|
||||||
)
|
)
|
||||||
stage_one_second_evolution = self.setup_pokemon_evolution_data(
|
stage_one_second_evolution = self.setup_pokemon_evolution_data(
|
||||||
evolved_species=stage_one_second, min_level=7
|
evolved_species=stage_one_second, min_level=7
|
||||||
|
|
Loading…
Reference in a new issue