def test_generate_omschrijving_urgent(self): stadsdeel = self.signal.location.stadsdeel correct = 'SIA-{}.02 URGENT {} {}'.format( self.signal.pk, SIGMAX_STADSDEEL_MAPPING.get(stadsdeel, 'SD--'), self.signal.location.short_address_text) seq_no = '02' self.assertEqual(_generate_omschrijving(self.signal, seq_no), correct)
def test_stadsdeel_mapping(self): # Check that all known STADSDELEN (city districts) have a code for use # by Sigmax/CityControl. seq_no = '01' for short_code, name in STADSDELEN: self.signal.location.stadsdeel = short_code self.signal.location.save() self.signal.refresh_from_db() self.assertNotRegex(_generate_omschrijving(self.signal, seq_no), 'SD--')
def test_generate_omschrijving_no_stadsdeel_urgent(self): # test that we get SD-- as part of the omschrijving when stadsdeel is missing self.signal.location.stadsdeel = None self.signal.location.save() correct = 'SIA-{}.04 URGENT SD-- {}'.format( self.signal.pk, self.signal.location.short_address_text) seq_no = '04' self.assertEqual(_generate_omschrijving(self.signal, seq_no), correct)