fix: run black

This commit is contained in:
Alessandro Pezzè 2020-11-23 22:05:49 +01:00
parent 71d75c3540
commit 464aeea4af
8 changed files with 557 additions and 184 deletions

View file

@ -17,7 +17,9 @@ CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://cache:6379/1",
"OPTIONS": {"CLIENT_CLASS": "django_redis.client.DefaultClient",},
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
},
}
}

View file

@ -17,7 +17,9 @@ CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"OPTIONS": {"CLIENT_CLASS": "django_redis.client.DefaultClient",},
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
},
}
}

View file

@ -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
TASTYPIE_FULL_DEBUG = True

View file

@ -72,7 +72,9 @@ CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://127.0.0.1:6379/1",
"OPTIONS": {"CLIENT_CLASS": "django_redis.client.DefaultClient",},
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
},
}
}

View file

@ -32,7 +32,9 @@ class Migration(migrations.Migration):
),
),
],
options={"abstract": False,},
options={
"abstract": False,
},
),
migrations.CreateModel(
name="PokemonFormSprites",
@ -58,7 +60,9 @@ class Migration(migrations.Migration):
),
),
],
options={"abstract": False,},
options={
"abstract": False,
},
),
migrations.CreateModel(
name="PokemonSprites",
@ -84,6 +88,8 @@ class Migration(migrations.Migration):
),
),
],
options={"abstract": False,},
options={
"abstract": False,
},
),
]

View file

@ -6,13 +6,13 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pokemon_v2', '0007_auto_20200815_0610'),
("pokemon_v2", "0007_auto_20200815_0610"),
]
operations = [
migrations.AlterField(
model_name='pokemonformname',
name='pokemon_name',
model_name="pokemonformname",
name="pokemon_name",
field=models.CharField(max_length=60),
),
]

View file

@ -17,7 +17,9 @@ class APIData:
@classmethod
def setup_gender_data(cls, name="gndr"):
gender = Gender.objects.create(name=name,)
gender = Gender.objects.create(
name=name,
)
gender.save()
return gender
@ -27,7 +29,11 @@ class APIData:
def setup_language_data(cls, name="lang"):
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()
@ -115,7 +121,10 @@ class APIData:
@classmethod
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()
return version
@ -218,7 +227,9 @@ class APIData:
@classmethod
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()
return item_attribute
@ -260,7 +271,9 @@ class APIData:
@classmethod
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()
return item_fling_effect
@ -282,7 +295,9 @@ class APIData:
@classmethod
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()
return item_pocket
@ -417,7 +432,9 @@ class APIData:
@classmethod
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()
return contest_type
@ -473,7 +490,9 @@ class APIData:
@classmethod
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()
return super_contest_effect
@ -522,7 +541,9 @@ class APIData:
@classmethod
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()
return berry_firmness
@ -590,7 +611,9 @@ class APIData:
@classmethod
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()
return egg_group
@ -1271,7 +1294,9 @@ class APIData:
):
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()
@ -1302,7 +1327,10 @@ class APIData:
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()
return pokedex
@ -1349,7 +1377,9 @@ class APIData:
@classmethod
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()
return pokemon_habitat
@ -1369,7 +1399,9 @@ class APIData:
@classmethod
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()
return pokemon_color
@ -1389,7 +1421,9 @@ class APIData:
@classmethod
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()
return pokemon_shape
@ -1753,7 +1787,9 @@ class APIData:
@classmethod
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()
return evolution_trigger
@ -3312,9 +3348,11 @@ class APITests(APIData, APITestCase):
def test_super_contest_effect_api(self):
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"
)
)
move = self.setup_move_data(
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="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_flavor_text = self.setup_pokemon_species_flavor_text_data(
pokemon_species, flavor_text="flvr txt for pkmn spcs"
)
@ -5217,11 +5257,14 @@ class APITests(APIData, APITestCase):
evolution_chain = self.setup_evolution_chain_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(
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(
evolved_species=stage_one_first, min_level=7
@ -5237,7 +5280,9 @@ class APITests(APIData, APITestCase):
)
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(
evolved_species=stage_one_second, min_level=7