From b9a077f5d74ad7359db05bb16d970cf29885f872 Mon Sep 17 00:00:00 2001 From: Roberta Takenaka Date: Wed, 22 Jul 2026 11:42:26 -0300 Subject: [PATCH] Cria location/tests, move location/tests.py para tests e cria test_mixins --- location/tests/__init__.py | 0 location/tests/test_mixins.py | 28 ++++++++++++++++++++++++++++ location/{ => tests}/tests.py | 0 3 files changed, 28 insertions(+) create mode 100644 location/tests/__init__.py create mode 100644 location/tests/test_mixins.py rename location/{ => tests}/tests.py (100%) diff --git a/location/tests/__init__.py b/location/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/location/tests/test_mixins.py b/location/tests/test_mixins.py new file mode 100644 index 000000000..b55e04513 --- /dev/null +++ b/location/tests/test_mixins.py @@ -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 + ) diff --git a/location/tests.py b/location/tests/tests.py similarity index 100% rename from location/tests.py rename to location/tests/tests.py