Add functionality for drawing folium.Maps

- this code is not unit-tested due to the complexity involving
  interactive `folium.Map`s => visual checks give high confidence
This commit is contained in:
Alexander Hess 2021-01-26 17:07:50 +01:00
commit 4b6d92958d
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
12 changed files with 714 additions and 13 deletions

View file

@ -48,7 +48,7 @@ class AddressFactory(alchemy.SQLAlchemyModelFactory):
# As non-primary addresses have no different behavior and
# the property is only kept from the original dataset for
# completeness sake, that is ok to do.
_primary_id = factory.LazyAttribute(lambda obj: obj.id)
primary_id = factory.LazyAttribute(lambda obj: obj.id)
# Mimic a Google Maps Place ID with just random characters.
place_id = factory.LazyFunction(

View file

@ -39,8 +39,8 @@ class TestConstraints:
def test_delete_a_referenced_address(self, db_session, address, make_address):
"""Remove a record that is referenced with a FK."""
db_session.add(address)
# Fake another_address that has the same `._primary_id` as `address`.
db_session.add(make_address(_primary_id=address.id))
# Fake another_address that has the same `.primary_id` as `address`.
db_session.add(make_address(primary_id=address.id))
db_session.commit()
db_session.delete(address)
@ -109,7 +109,7 @@ class TestProperties:
def test_is_primary(self, address):
"""Test `Address.is_primary` property."""
assert address.id == address._primary_id
assert address.id == address.primary_id
result = address.is_primary
@ -117,7 +117,7 @@ class TestProperties:
def test_is_not_primary(self, address):
"""Test `Address.is_primary` property."""
address._primary_id = 999
address.primary_id = 999
result = address.is_primary