Generate the fake coordinates as floats
Also, remove the misleading comment in `Location`
This commit is contained in:
parent
3b8b041a3e
commit
8abc93987e
2 changed files with 2 additions and 3 deletions
|
|
@ -22,7 +22,6 @@ class Location:
|
||||||
|
|
||||||
def __init__(self, latitude: float, longitude: float) -> None:
|
def __init__(self, latitude: float, longitude: float) -> None:
|
||||||
"""Create a location from a WGS84-conforming `latitude`-`longitude` pair."""
|
"""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._latitude = float(latitude)
|
||||||
self._longitude = float(longitude)
|
self._longitude = float(longitude)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,8 @@ class AddressFactory(alchemy.SQLAlchemyModelFactory):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Place the addresses somewhere in downtown Paris.
|
# Place the addresses somewhere in downtown Paris.
|
||||||
latitude = factory.Faker("coordinate", center=48.855, radius=0.01)
|
latitude = factory.Faker("pyfloat", min_value=48.845, max_value=48.865)
|
||||||
longitude = factory.Faker("coordinate", center=2.34, radius=0.03)
|
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 -> set by the `make_address` fixture as there is only one `city`
|
||||||
city_name = "Paris"
|
city_name = "Paris"
|
||||||
zip_code = factory.LazyFunction(lambda: random.randint(75001, 75020))
|
zip_code = factory.LazyFunction(lambda: random.randint(75001, 75020))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue