grenoble_gru: cleanup phone numbers (#78187)
gitea/passerelle/pipeline/head This commit looks good
Details
gitea/passerelle/pipeline/head This commit looks good
Details
This commit is contained in:
parent
2cac256517
commit
166d58591a
|
@ -107,6 +107,11 @@ class GrenobleGRU(BaseResource):
|
|||
payload = {'id': data['application_id']}
|
||||
payload['dem_comp'] = types_params['dem_comp'] = data.get('dem_comp', 'Voirie')
|
||||
|
||||
for key, value in data.items():
|
||||
if key.endswith('_phone'):
|
||||
phone = ''.join(x for x in value if x in '0123456789')
|
||||
data[key] = phone
|
||||
|
||||
payload.update(
|
||||
{
|
||||
# applicant informations
|
||||
|
|
|
@ -229,6 +229,7 @@ def test_demand_creation_params(app, setup):
|
|||
payload = BASIC_PAYLOAD.copy()
|
||||
payload['intervention_free_address'] = '169, rue du Château'
|
||||
payload['applicant_free_address'] = '1, rue de l\'Est'
|
||||
payload['applicant_phone'] = '01-02.03 04 05'
|
||||
app.post_json(
|
||||
reverse(
|
||||
'generic-endpoint',
|
||||
|
@ -243,6 +244,7 @@ def test_demand_creation_params(app, setup):
|
|||
assert request_post.call_args[1]['data']['dem_pav'] == 'déchetterie'
|
||||
assert request_post.call_args[1]['data']['dem_reponse'] == 0
|
||||
assert request_post.call_args[1]['data']['obs_description_probleme'] == 'thank you '
|
||||
assert request_post.call_args[1]['data']['dem_tel'] == '0102030405'
|
||||
|
||||
payload['applicant_requires_reply'] = True
|
||||
payload['urgent_demand'] = 'True'
|
||||
|
|
Loading…
Reference in New Issue