Generate the fake coordinates as floats

Also, remove the misleading comment in `Location`
This commit is contained in:
Alexander Hess 2026-12-01 15:27:53 +01:00
commit 8abc93987e
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
2 changed files with 2 additions and 3 deletions

View file

@ -22,7 +22,6 @@ class Location:
def __init__(self, latitude: float, longitude: float) -> None:
"""Create a location from a WGS84-conforming `latitude`-`longitude` pair."""
# The SQLAlchemy columns come as `Decimal`s due to the `DOUBLE_PRECISION`.
self._latitude = float(latitude)
self._longitude = float(longitude)

View file

@ -32,8 +32,8 @@ class AddressFactory(alchemy.SQLAlchemyModelFactory):
)
# Place the addresses somewhere in downtown Paris.
latitude = factory.Faker("coordinate", center=48.855, radius=0.01)
longitude = factory.Faker("coordinate", center=2.34, radius=0.03)
latitude = factory.Faker("pyfloat", min_value=48.845, max_value=48.865)
longitude = factory.Faker("pyfloat", min_value=2.31, max_value=2.37)
# city -> set by the `make_address` fixture as there is only one `city`
city_name = "Paris"
zip_code = factory.LazyFunction(lambda: random.randint(75001, 75020))