diff --git a/lemarche/templates/tenders/list.html b/lemarche/templates/tenders/list.html
index 540f7774f..0df3388e5 100644
--- a/lemarche/templates/tenders/list.html
+++ b/lemarche/templates/tenders/list.html
@@ -47,7 +47,7 @@
{{ page_title }}
{% url 'tenders:list' as TENDERS_LIST_URL %}
{% url 'tenders:list' status=tender_constants.STATUS_DRAFT as TENDERS_DRAFT_LIST_URL %}
{% url 'tenders:list' status=tender_constants.STATUS_PUBLISHED as TENDERS_PUBLISHED_LIST_URL %}
- {% url 'tenders:list' status=tender_constants.STATUS_VALIDATED as TENDERS_VALIDATED_LIST_URL %}
+ {% url 'tenders:list' status=tender_constants.STATUS_SENT as TENDERS_SENT_LIST_URL %}
{{ page_title }}
-
Envoyé
@@ -93,7 +93,7 @@ {{ page_title }}
{% if request.get_full_path == TENDERS_PUBLISHED_LIST_URL %}
Vous n'avez aucun besoin en cours de validation pour le moment.
{% endif %}
- {% if request.get_full_path == TENDERS_VALIDATED_LIST_URL %}
+ {% if request.get_full_path == TENDERS_SENT_LIST_URL %}
Vous n'avez aucun besoin d'envoyé pour le moment.
Contacter notre équipe en cas de problème avec un de vos dépôts de besoins en cours de validation.
diff --git a/lemarche/tenders/factories.py b/lemarche/tenders/factories.py
index 067da52b9..d55800318 100644
--- a/lemarche/tenders/factories.py
+++ b/lemarche/tenders/factories.py
@@ -35,6 +35,7 @@ class Meta:
start_working_date = date.today() + timedelta(days=random.randint(12, 90))
author = factory.SubFactory(UserFactory)
validated_at = timezone.now()
+ sent_at = timezone.now()
external_link = factory.Sequence("https://{0}example.com".format)
# Contact fields
contact_first_name = factory.Sequence("first_name{0}".format)
@@ -43,7 +44,7 @@ class Meta:
contact_phone = factory.fuzzy.FuzzyText(length=10, chars=string.digits)
# amount = tender_constants.AMOUNT_RANGE_100_150
# marche_benefits = factory.fuzzy.FuzzyChoice([key for (key, _) in constants.MARCHE_BENEFIT_CHOICES])
- status = tender_constants.STATUS_VALIDATED
+ status = tender_constants.STATUS_SENT
@factory.post_generation
def perimeters(self, create, extracted, **kwargs):
diff --git a/lemarche/tenders/tests.py b/lemarche/tenders/tests.py
index ded7c2506..22cbfd4fa 100644
--- a/lemarche/tenders/tests.py
+++ b/lemarche/tenders/tests.py
@@ -109,10 +109,12 @@ def test_status(self):
tender_pending_validation = TenderFactory(status=tender_constants.STATUS_PUBLISHED)
tender_validated_half = TenderFactory(status=tender_constants.STATUS_VALIDATED)
tender_validated_full = TenderFactory(status=tender_constants.STATUS_VALIDATED, validated_at=timezone.now())
+ tender_sent = TenderFactory(status=tender_constants.STATUS_SENT, sent_at=timezone.now())
self.assertTrue(tender_draft.is_draft, True)
self.assertTrue(tender_pending_validation.is_pending_validation, True)
self.assertTrue(tender_validated_half.is_validated, False)
self.assertTrue(tender_validated_full.is_validated, True)
+ self.assertTrue(tender_sent.is_sent, True)
def test_amount_display(self):
tender_with_amount = TenderFactory(amount=tender_constants.AMOUNT_RANGE_0_1, accept_share_amount=True)
diff --git a/lemarche/www/dashboard_networks/tests.py b/lemarche/www/dashboard_networks/tests.py
index 7ce800fa1..5cea5074e 100644
--- a/lemarche/www/dashboard_networks/tests.py
+++ b/lemarche/www/dashboard_networks/tests.py
@@ -35,7 +35,7 @@ def setUpTestData(cls):
author=cls.user_buyer,
amount=tender_constants.AMOUNT_RANGE_100_150,
accept_share_amount=False,
- status=tender_constants.STATUS_VALIDATED,
+ status=tender_constants.STATUS_SENT,
validated_at=timezone.now(),
deadline_date=timezone.now() - timedelta(days=5),
)
diff --git a/lemarche/www/tenders/tests.py b/lemarche/www/tenders/tests.py
index edd9d0694..762413964 100644
--- a/lemarche/www/tenders/tests.py
+++ b/lemarche/www/tenders/tests.py
@@ -515,6 +515,8 @@ def setUpTestData(cls):
response_kind=[tender_constants.RESPONSE_KIND_EMAIL],
sectors=[sector_1],
location=grenoble_perimeter,
+ status=tender_constants.STATUS_SENT,
+ sent_at=timezone.now(),
)
cls.tendersiae_1_1 = TenderSiae.objects.create(
tender=cls.tender_1,
@@ -528,7 +530,7 @@ def setUpTestData(cls):
TenderQuestionFactory(tender=cls.tender_1)
cls.tender_2 = TenderFactory(author=cls.user_buyer_1, contact_company_name="Another company")
- def test_anyone_can_view_validated_tenders(self):
+ def test_anyone_can_view_sent_tenders(self):
# anonymous
url = reverse("tenders:detail", kwargs={"slug": self.tender_1.slug})
response = self.client.get(url)
@@ -541,12 +543,18 @@ def test_anyone_can_view_validated_tenders(self):
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
- def test_only_author_or_admin_can_view_non_validated_tender(self):
+ def test_only_author_or_admin_can_view_non_sent_tender(self):
tender_draft = TenderFactory(author=self.user_buyer_1, status=tender_constants.STATUS_DRAFT)
tender_published = TenderFactory(
author=self.user_buyer_1, status=tender_constants.STATUS_PUBLISHED, published_at=timezone.now()
)
- for tender in [tender_draft, tender_published]:
+ tender_validated_but_not_sent = TenderFactory(
+ author=self.user_buyer_1,
+ status=tender_constants.STATUS_VALIDATED,
+ published_at=timezone.now(),
+ validated_at=timezone.now(),
+ )
+ for tender in [tender_draft, tender_published, tender_validated_but_not_sent]:
# anonymous
url = reverse("tenders:detail", kwargs={"slug": tender.slug})
response = self.client.get(url)