Skip to content

Commit

Permalink
fix CI issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonavic committed Nov 1, 2024
1 parent 5ebe55e commit 3abbb73
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
STADSDEEL_WESTPOORT,
STADSDEEL_ZUID,
STADSDEEL_ZUIDOOST,
Priority,
Buurt
Buurt,
Priority
)

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -81,6 +81,7 @@ def _generate_omschrijving(signal, seq_no):
f" {area}" if area else ''
)


def _determine_area_for_omschrijving(signal, buurt, stadsdeel_code_sigmax):
if stadsdeel_code_sigmax is not None:
return stadsdeel_code_sigmax
Expand All @@ -90,6 +91,7 @@ def _determine_area_for_omschrijving(signal, buurt, stadsdeel_code_sigmax):
return signal.location.area_name
return None


def _address_matches_sigmax_expectation(address_dict):
"""Return whether an address has all information Sigmax/CityControl needs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
_generate_creeerZaak_Lk01,
_generate_omschrijving
)
from signals.apps.signals.factories import SignalFactory, SignalFactoryValidLocation, BuurtFactory
from signals.apps.signals.factories import BuurtFactory, SignalFactory, SignalFactoryValidLocation
from signals.apps.signals.models import STADSDELEN, Priority, Signal
from signals.apps.signals.tests.valid_locations import STADHUIS

Expand Down Expand Up @@ -179,7 +179,10 @@ def test_stadsdeel_mapping(self) -> None:
self.signal.location.stadsdeel = short_code
self.signal.location.save()
self.signal.refresh_from_db()
self.assertRegex(_generate_omschrijving(self.signal, seq_no), SIGMAX_STADSDEEL_MAPPING.get(short_code, None))
self.assertRegex(
_generate_omschrijving(self.signal, seq_no),
SIGMAX_STADSDEEL_MAPPING.get(short_code, None)
)

def test_generate_omschrijving_with_buurt(self) -> None:
# test that we get buurt as part of the omschrijving when stadsdeel is missing
Expand All @@ -190,7 +193,7 @@ def test_generate_omschrijving_with_buurt(self) -> None:
signal.location.save()

correct = '{} SIA-{}.01 {} {}'.format(
signal.category_assignment.category.name,
signal.category_assignment.category.name,
signal.pk,
signal.location.short_address_text,
buurt.naam
Expand Down
2 changes: 1 addition & 1 deletion app/signals/apps/signals/factories/buurt.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: MPL-2.0
# Copyright (C) 2020 - 2023 Gemeente Amsterdam
from factory.django import DjangoModelFactory
from factory.fuzzy import FuzzyText, FuzzyInteger
from factory.fuzzy import FuzzyInteger, FuzzyText

from signals.apps.signals.models import Buurt

Expand Down

0 comments on commit 3abbb73

Please sign in to comment.