Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added location/tests/__init__.py
Empty file.
28 changes: 28 additions & 0 deletions location/tests/test_mixins.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from location.models import City, Country, Location, State


class LocationTestMixin:
"""Mixin com helpers para criar objetos do app location em testes."""

def make_location(
self,
user,
country_name="Brazil",
country_acronym="BR",
country_acron3="BRA",
state_name="São Paulo",
state_acronym="SP",
city_name="São Paulo",
):

country = Country.create_or_update(
user=user,
name=country_name,
acronym=country_acronym,
acron3=country_acron3,
)
state = State.create(user=user, name=state_name, acronym=state_acronym)
city = City.create(user=user, name=city_name)
return Location._create(
user=user, country=country, state=state, city=city
)
File renamed without changes.
Loading