0001-atal-use-comma-in-coordinates-35180.patch
passerelle/apps/atal/models.py | ||
---|---|---|
152 | 152 |
if recv in post_data: |
153 | 153 |
data[send] = post_data[recv] |
154 | 154 | |
155 |
for coord_key in ('coordX', 'coordY'): |
|
156 |
if coord_key in data: |
|
157 |
data[coord_key] = data[coord_key].replace('.', ',') |
|
158 | ||
155 | 159 |
demande_number = self._soap_call( |
156 | 160 |
wsdl='DemandeService', method='insertDemandeCompletByType', **data |
157 | 161 |
) |
tests/test_atal.py | ||
---|---|---|
104 | 104 |
assert call_params['method'] == 'getTypesEquipement' |
105 | 105 | |
106 | 106 | |
107 |
def test_insert_demande_complet_by_type(app, connector, monkeypatch):
|
|
107 |
def test_insert_action_comment(app, connector, monkeypatch):
|
|
108 | 108 |
mock_soap_call = mock_atal_soap_call(monkeypatch, return_value='DIT19050001') |
109 | 109 |
params = { |
110 | 110 |
'numero_demande': 'DIT19050001', |
... | ... | |
122 | 122 |
assert call_params['commentaire'] == 'aaa' |
123 | 123 | |
124 | 124 | |
125 |
def test_insert_demande_complet_by_type(app, connector, monkeypatch): |
|
126 |
mock_soap_call = mock_atal_soap_call(monkeypatch, return_value='DIT19050001') |
|
127 |
params = { |
|
128 |
'type_demande': 'VOIRIE', |
|
129 |
'coord_x': '48.866667', 'coord_y': '2.333333' |
|
130 |
} |
|
131 |
response = app.post_json('/atal/slug-atal/insert-demande-complet-by-type', params=params) |
|
132 |
assert response.json == { |
|
133 |
'err': 0, |
|
134 |
'data': {'demande_number': 'DIT19050001'} |
|
135 |
} |
|
136 |
call_params = mock_soap_call.call_args.kwargs |
|
137 |
assert call_params['wsdl'] == 'DemandeService' |
|
138 |
assert call_params['method'] == 'insertDemandeCompletByType' |
|
139 |
assert call_params['typeDemande'] == 'VOIRIE' |
|
140 |
assert call_params['coordX'] == '48,866667' |
|
141 |
assert call_params['coordY'] == '2,333333' |
|
142 | ||
143 | ||
125 | 144 |
def test_upload(app, connector, monkeypatch): |
126 | 145 |
mock_soap_call = mock_atal_soap_call(monkeypatch, return_value=None) |
127 | 146 |
base64_str = 'eyJsYXN0X2NoZWNrIjoiMjAxOS0wNC0xMFQxMjowODoyOVoiL' + \ |
128 |
- |