Skip to content

Commit

Permalink
Modification du label du champs "Contraintes"
Browse files Browse the repository at this point in the history
rename constraints tender field (#1080)
  • Loading branch information
SebastienReuiller authored Feb 19, 2024
1 parent dc791d1 commit 7df3ba5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lemarche/templates/tenders/_detail_card.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand Down
17 changes: 17 additions & 0 deletions lemarche/tenders/migrations/0074_alter_tender_constraints.py
Original file line number Diff line number Diff line change
@@ -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 ?"),
),
]
3 changes: 1 addition & 2 deletions lemarche/tenders/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions lemarche/www/tenders/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7df3ba5

Please sign in to comment.