Skip to content

Commit

Permalink
Tests - Adaptation pour 2024 et fichiers TOPO
Browse files Browse the repository at this point in the history
  • Loading branch information
mdouchin committed Feb 4, 2025
1 parent 275d4d8 commit 98dcfd2
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 23 deletions.
12 changes: 6 additions & 6 deletions cadastre/dialogs/search_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,8 @@ def refreshAutocomplete(self, key):
# Build SQL query
hasCommuneFilter = None
if key == 'adresse':
sql = " SELECT DISTINCT v.voie, c.tex2 AS libcom, Coalesce(v.natvoi, '') AS natvoi, coalesce(v.libvoi, '') AS libvoi"
sql = " SELECT DISTINCT v.voie, c.tex2 AS libcom, "
sql += " trim(Coalesce(v.natvoi, '') || coalesce(v.libvoi, '')) AS natlibvoi"
if self.dbType == 'postgis':
sql += ' FROM "{}"."voie" v'.format(connectionParams['schema'])
else:
Expand All @@ -602,7 +603,7 @@ def refreshAutocomplete(self, key):
hasCommuneFilter = True

# order
sql += ' ORDER BY c.tex2, natvoi, libvoi'
sql += ' ORDER BY c.tex2, natlibvoi'

elif key == 'proprietaire':

Expand Down Expand Up @@ -656,7 +657,7 @@ def refreshAutocomplete(self, key):
sql += " SELECT\r\n"
sql += " ccocom, comptecommunal, dnuper, dnomus, dprnus,\r\n"
sql += " CASE\r\n"
sql += " WHEN gtoper = '1' THEN COALESCE(rtrim(dqualp),'')||' '||COALESCE(rtrim(dnomlp),'')||' '||COALESCE(rtrim(dprnlp),'')\r\n"
sql += " WHEN gtoper = '1' THEN COALESCE(rtrim(dqualp), '')||' '||COALESCE(rtrim(dnomlp),'')||' '||COALESCE(rtrim(dprnlp),'')\r\n"
sql += " WHEN gtoper = '2' THEN trim(ddenom)\r\n"
sql += " END AS nom_naissance\r\n"
sql += sqlFrom
Expand Down Expand Up @@ -693,10 +694,9 @@ def refreshAutocomplete(self, key):
maxStringSize = 0
for line in data:
if key == 'adresse':
label = '{} | {} {}'.format(
label = '{} | {}'.format(
line[1].strip(),
line[2].strip(),
line[3].strip()
line[2].strip()
)
val = {'voie': line[0]}

Expand Down
3 changes: 1 addition & 2 deletions cadastre/tests/fixtures/majic/13029/REVBATI.800
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
132 BOUCHES-DU-RHONE-AIX D404052019 2019
132 BOUCHES-DU-RHONE-AIX D404052019 2024
132029 CORNILLON-CONFOUX

3 changes: 1 addition & 2 deletions cadastre/tests/fixtures/majic/13029/REVD166.800
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
132 D404052019 2019
132 D404052019 2024
132029 CORNILLON-CONFOUX

3 changes: 1 addition & 2 deletions cadastre/tests/fixtures/majic/13029/REVFPDL.800
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
132 BOUCHES-DU-RHONE-AIX D406052019
132 BOUCHES-DU-RHONE-AIX D406052024
132029 CORNILLON-CONFOUX

3 changes: 1 addition & 2 deletions cadastre/tests/fixtures/majic/13029/REVNBAT.800
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
132 BOUCHES-DU-RHONE-AIX D404052019 201900000000111 00004286082
132 BOUCHES-DU-RHONE-AIX D404052019 202400000000111 00004286082
132029 CORNILLON-CONFOUX

3 changes: 1 addition & 2 deletions cadastre/tests/fixtures/majic/13029/REVPROP.800
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
132 BOUCHES-DU-RHONE-AIX D404052019
132 BOUCHES-DU-RHONE-AIX D404052024
132029 CORNILLON-CONFOUX

3 changes: 0 additions & 3 deletions cadastre/tests/fixtures/majic/13029/TOPFANR.800

This file was deleted.

14 changes: 14 additions & 0 deletions cadastre/tests/fixtures/majic/13029/TOPO_test.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
code topo;libelle;type commune actuel (R ou N);type commune FIP (R ou NFIP);RUR actuel;RUR FIP;caractere voie;annulation;date annulation;date creation de article;type voie;mot classant;date derniere transition
991009313 12;BOUCHES-DU-RHONE;;;;;;;00000000;17900304;;;00000000
991009313029 13;CORNILLON-CONFOUX;N;N;3;3;;;00000000;18750101;;;00000000
991009313029B02314;CAMPREOUX;;;;;0;;00000000;19870101;3;CAMPREOU;00000000
991009313029B09514;GOUFRAN;;;;;0;;00000000;19870101;3;GOUFRAN;00000000
991009313029140014;RTE DE CONFOUX;;;;;0;;00000000;20180424;1;CONFOUX;00000000
991009313029265014;RUE DU FIGUIER;;;;;0;;00000000;19870101;1;FIGUIER;20241110
991009313029492514;CHE DES LOUANES;;;;;0;;00000000;19911028;1;LOUANES;00000000
991009313029150014;CHEMDE LA COOPERATIVE;;;;;0;;00000000;20180424;1;COOPERAT;00000000
991009313029545014;RUE DU MASE;;;;;0;;00000000;19870101;1;MASE;00000000
991009313029755014;ALL DU ROMARIN;;;;;0;;00000000;20201221;1;ROMARIN;00000000
991009313029A32114;CITEDES AIRES;;;;;1;;00000000;19911028;2;AIRES;00000000
991009313029B11114;LE LIS;;;;;0;;00000000;19870101;3;LIS;00000000
991009313029015014;VC MONTEE DES AIRES;;;;;0;;00000000;19870101;1;AIRES;00000000
8 changes: 4 additions & 4 deletions cadastre/tests/test_import_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class TestCase(namedtuple('TestCase', [
ccocom='029',
ccodir='2',
direction='2',
version='2019',
year='2019',
version='2024',
year='2024',
geo_commune='132029',
)

Expand All @@ -42,8 +42,8 @@ class TestCase(namedtuple('TestCase', [
ccocom='029',
ccodir='2',
direction='2',
version='2019',
year='2019',
version='2024',
year='2024',
geo_commune='132029',
)

Expand Down

0 comments on commit 98dcfd2

Please sign in to comment.