From 7df3ba58f90eb607c038c67d36e8871b506a3909 Mon Sep 17 00:00:00 2001 From: SebastienReuiller <sebastien@reuiller.email> Date: Mon, 19 Feb 2024 09:48:59 +0100 Subject: [PATCH] Modification du label du champs "Contraintes" rename constraints tender field (#1080) --- lemarche/templates/tenders/_detail_card.html | 2 +- .../migrations/0074_alter_tender_constraints.py | 17 +++++++++++++++++ lemarche/tenders/models.py | 3 +-- lemarche/www/tenders/tests.py | 4 ++-- 4 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 lemarche/tenders/migrations/0074_alter_tender_constraints.py diff --git a/lemarche/templates/tenders/_detail_card.html b/lemarche/templates/tenders/_detail_card.html index d3ec24561..d55f4a364 100644 --- a/lemarche/templates/tenders/_detail_card.html +++ b/lemarche/templates/tenders/_detail_card.html @@ -73,7 +73,7 @@ <h2> <!-- tender constraints --> {% if tender.constraints %} <hr class="my-5"> - <h2>Contraintes techniques spécifiques</h2> + <h2>Comment répondre à cette demande ?</h2> <p>{{ tender.constraints|default:"-"|safe|linebreaks }}</p> {% endif %} <!-- tender amount --> diff --git a/lemarche/tenders/migrations/0074_alter_tender_constraints.py b/lemarche/tenders/migrations/0074_alter_tender_constraints.py new file mode 100644 index 000000000..e7023e341 --- /dev/null +++ b/lemarche/tenders/migrations/0074_alter_tender_constraints.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.2 on 2024-02-13 15:12 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("tenders", "0073_tendersiae_survey_transactioned_amount_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="tender", + name="constraints", + field=models.TextField(blank=True, verbose_name="Comment répondre à cette demande ?"), + ), + ] diff --git a/lemarche/tenders/models.py b/lemarche/tenders/models.py index 59c86aade..4e907f8a6 100644 --- a/lemarche/tenders/models.py +++ b/lemarche/tenders/models.py @@ -270,8 +270,7 @@ class Tender(models.Model): default=list, ) constraints = models.TextField( - verbose_name="Contraintes techniques spécifiques", - help_text="Renseignez les contraintes liées à votre besoin", + verbose_name="Comment répondre à cette demande ?", blank=True, ) external_link = models.URLField( diff --git a/lemarche/www/tenders/tests.py b/lemarche/www/tenders/tests.py index 43e17f5d7..5c92eec2f 100644 --- a/lemarche/www/tenders/tests.py +++ b/lemarche/www/tenders/tests.py @@ -766,13 +766,13 @@ def test_tender_constraints_display(self): url = reverse("tenders:detail", kwargs={"slug": self.tender_1.slug}) response = self.client.get(url) self.assertEqual(response.status_code, 200) - self.assertContains(response, "Contraintes techniques spécifiques") + self.assertContains(response, "Comment répondre à cette demande ?") # tender without constraints: section should be hidden tender_2 = TenderFactory(author=self.user_buyer_2, constraints="") url = reverse("tenders:detail", kwargs={"slug": tender_2.slug}) response = self.client.get(url) self.assertEqual(response.status_code, 200) - self.assertNotContains(response, "Contraintes techniques spécifiques") + self.assertNotContains(response, "Comment répondre à cette demande ?") def test_tender_amount_display(self): # tender with amount + accept_share_amount: section should be visible