Skip to content

Commit

Permalink
Les acteurs d'un code EPCI ne s'affichent pas lorsqu'il est configuré (
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienheureux authored Nov 27, 2024
1 parent 8e9f5b0 commit dc25c5d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
18 changes: 18 additions & 0 deletions integration_tests/qfdmo/test_adresses_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,3 +486,21 @@ def test_bbox_and_acteurs_are_returned_if_contained_in_bbox(self):
bbox, acteurs = adresses_view._bbox_and_acteurs_from_location_or_epci(acteurs)
assert bbox == bbox
assert acteurs.count() == 2


@pytest.mark.django_db
class TestLayers:
def test_adresse_missing_layer_is_displayed(self, client):
url = "/carte"
response = client.get(url)
assert 'data-testid="adresse-missing"' in str(response.content)

def test_adresse_missing_layer_is_not_displayed_with_bbox(self, client):
url = "/carte=1&direction=jai&bounding_box=%7B%22southWest%22%3A%7B%22lat%22%3A48.916%2C%22lng%22%3A2.298202514648438%7D%2C%22northEast%22%3A%7B%22lat%22%3A48.98742568330284%2C%22lng%22%3A2.483596801757813%7D%7D" # noqa: E501
response = client.get(url)
assert 'data-testid="adresse-missing"' not in str(response.content)

def test_adresse_missing_layer_is_not_displayed_for_epcis(self, client):
url = "/carte?action_list=reparer%7Cdonner%7Cechanger%7Cpreter%7Cemprunter%7Clouer%7Cmettreenlocation%7Cacheter%7Crevendre&epci_codes=200055887&limit=50" # noqa: E501
response = client.get(url)
assert 'data-testid="adresse-missing"' not in str(response.content)
1 change: 1 addition & 0 deletions jinja2/qfdmo/shared/disclaimers/adresse_missing.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<div
class="qf-absolute qf-top-1w qf-bottom-1w qf-left-1w qf-right-1w qf-border qf-border-grey-900 qf-border-solid
qf-flex qf-flex-row qf-justify-center group-aria-[busy]:qf-hidden"
data-testid="adresse-missing"
>
<picture>
<source srcset="{{ static("map-background-mobile.png")}}" media="(orientation: portrait)">
Expand Down
2 changes: 1 addition & 1 deletion jinja2/qfdmo/shared/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
They need to match the css variables used for .grid-map selector in qfdmo.css
#}

{% with address_ok=(form.initial.adresse or form.initial.bounding_box) %}
{% with address_ok=(form.initial.adresse or form.initial.bounding_box or form.initial.epci_codes) %}
<div
class="
qf-relative
Expand Down

0 comments on commit dc25c5d

Please sign in to comment.