-
-
- -
- {% dsfr_button label="Enregistrer mes modifications" extra_classes="fr-mt-4v" %}
-
-
+
+
{% dsfr_form_field form.sectors %}
+
+
+
+ Secteurs d'activité
+
+
+ Améliorez votre référencement en indiquant tous les secteurs d'activités sur lesquels votre struture est positionnée.
+
+
+
-
-
-
+
{% endblock content_siae_form %}
-
{% block extra_js %}
-
+
{% endblock extra_js %}
diff --git a/lemarche/www/dashboard_siaes/forms.py b/lemarche/www/dashboard_siaes/forms.py
index cc6fd93b1..807af632a 100644
--- a/lemarche/www/dashboard_siaes/forms.py
+++ b/lemarche/www/dashboard_siaes/forms.py
@@ -73,12 +73,14 @@ class SiaeEditSearchForm(forms.ModelForm):
choices=siae_constants.PRESTA_CHOICES,
required=True,
widget=forms.CheckboxSelectMultiple,
+ disabled=True,
)
geo_range = forms.ChoiceField(
label=Siae._meta.get_field("geo_range").verbose_name,
choices=siae_constants.GEO_RANGE_CHOICES,
required=True,
widget=forms.RadioSelect,
+ disabled=True,
)
sectors = GroupedModelMultipleChoiceField(
label=Sector._meta.verbose_name_plural,
@@ -86,6 +88,7 @@ class SiaeEditSearchForm(forms.ModelForm):
choices_groupby="group",
required=True,
widget=forms.CheckboxSelectMultiple,
+ disabled=True,
)
class Meta:
diff --git a/lemarche/www/siaes/tests.py b/lemarche/www/siaes/tests.py
index 15793bae0..40f2cad28 100644
--- a/lemarche/www/siaes/tests.py
+++ b/lemarche/www/siaes/tests.py
@@ -1,6 +1,7 @@
from unittest import mock
from django.contrib.gis.geos import Point
+from django.contrib.sites.models import Site
from django.test import TestCase
from django.urls import reverse
@@ -58,6 +59,11 @@ def setUpTestData(cls):
def test_search_num_queries(self):
url = reverse("siae:search_results")
+
+ # fix cache issue in parallel testing context because only first call fetches database
+ # See https://docs.djangoproject.com/en/5.1/ref/contrib/sites/#caching-the-current-site-object
+ Site.objects.get_current()
+
with self.assertNumQueries(12):
response = self.client.get(url)
siaes = list(response.context["siaes"])
@@ -1032,11 +1038,14 @@ def test_search_query_no_result(self):
mock_siaes_similarity_search.assert_called_once()
def test_search_query_with_results(self):
- with mock.patch(
- "lemarche.utils.apis.api_elasticsearch.siaes_similarity_search"
- ) as mock_siaes_similarity_search, mock.patch(
- "lemarche.utils.apis.api_elasticsearch.siaes_similarity_search_with_city"
- ) as mock_siaes_similarity_search_with_city:
+ with (
+ mock.patch(
+ "lemarche.utils.apis.api_elasticsearch.siaes_similarity_search"
+ ) as mock_siaes_similarity_search,
+ mock.patch(
+ "lemarche.utils.apis.api_elasticsearch.siaes_similarity_search_with_city"
+ ) as mock_siaes_similarity_search_with_city,
+ ):
mock_siaes_similarity_search.return_value = [self.siae_two.pk, self.siae_three.pk, self.siae_four.pk]
url = self.url + "?semantic_q=entretien espace vert&id_semantic_city_name=&semantic_city="
response = self.client.get(url)