From 6d3d016a7972c001acdc6daf6b9c6d754a701847 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Fri, 1 Dec 2023 09:39:40 +0100 Subject: [PATCH] Fix tests --- .../templates/tenders/_card_list_item.html | 4 ++-- .../tenders/_detail_admin_extra_info.html | 4 ++-- .../tenders/_detail_side_infos_author.html | 2 +- .../templates/tenders/_list_item_buyer.html | 10 ++++---- lemarche/templates/tenders/list.html | 8 +++---- lemarche/tenders/admin.py | 2 +- lemarche/tenders/factories.py | 5 ++-- lemarche/tenders/models.py | 6 ++++- lemarche/tenders/tests.py | 6 +++-- lemarche/utils/mixins.py | 6 ++--- lemarche/www/dashboard_networks/tests.py | 2 +- lemarche/www/pages/views.py | 2 +- lemarche/www/tenders/tests.py | 24 ++++++++++++++----- lemarche/www/tenders/views.py | 4 ++-- 14 files changed, 52 insertions(+), 33 deletions(-) diff --git a/lemarche/templates/tenders/_card_list_item.html b/lemarche/templates/tenders/_card_list_item.html index 0ce087f80..93d599d99 100644 --- a/lemarche/templates/tenders/_card_list_item.html +++ b/lemarche/templates/tenders/_card_list_item.html @@ -4,11 +4,11 @@ {% if tender.deadline_date_is_outdated_annotated %} Clôturé {% endif %} - {% if tender.status == tender.STATUS_DRAFT %} + {% if tender.is_draft %} Brouillon - {% elif tender.status == tender.STATUS_PUBLISHED %} + {% elif tender.is_pending_validation_or_validated %} En cours de validation diff --git a/lemarche/templates/tenders/_detail_admin_extra_info.html b/lemarche/templates/tenders/_detail_admin_extra_info.html index 4e5b05872..d4365f86e 100644 --- a/lemarche/templates/tenders/_detail_admin_extra_info.html +++ b/lemarche/templates/tenders/_detail_admin_extra_info.html @@ -7,8 +7,8 @@

Informations Admin

Publié le {{ tender.published_at|date }}
  • - {% if tender.is_validated %} - Validé le {{ tender.validated_at|date }} + {% if tender.is_sent %} + Validé le {{ tender.sent_at|date }} {% else %} Statut : {{ tender.get_status_display }} {% endif %} diff --git a/lemarche/templates/tenders/_detail_side_infos_author.html b/lemarche/templates/tenders/_detail_side_infos_author.html index d98847e18..d8c95fc0b 100644 --- a/lemarche/templates/tenders/_detail_side_infos_author.html +++ b/lemarche/templates/tenders/_detail_side_infos_author.html @@ -26,7 +26,7 @@ {% endif %} -{% if tender.is_validated %} +{% if tender.is_sent %}
    diff --git a/lemarche/templates/tenders/_list_item_buyer.html b/lemarche/templates/tenders/_list_item_buyer.html index f00044066..2ea06d275 100644 --- a/lemarche/templates/tenders/_list_item_buyer.html +++ b/lemarche/templates/tenders/_list_item_buyer.html @@ -9,15 +9,15 @@ {% if tender.deadline_date_is_outdated_annotated %} Clôturé {% endif %} - {% if tender.status == tender.STATUS_DRAFT %} + {% if tender.is_draft %} Brouillon - {% elif tender.status == tender.STATUS_PUBLISHED %} + {% elif tender.is_pending_validation_or_validated %} En cours de validation - {% elif tender.status == tender.STATUS_VALIDATED %} + {% elif tender.is_sent %} Envoyé @@ -33,7 +33,7 @@

    {{ tender.title }}

    Créé le {{ tender.created_at|date }}
    - {% if tender.status == tender.STATUS_VALIDATED %} + {% if tender.is_sent %}
    Publié le {{ tender.validated_at|date }} @@ -43,7 +43,7 @@

    {{ tender.title }}


    - {% if tender.status == tender.STATUS_VALIDATED %} + {% if tender.is_sent %} {% if tender.siae_detail_contact_click_since_last_seen_date_count_annotated %}  {{ tender.siae_detail_contact_click_since_last_seen_date_count_annotated }} nouveau{{ tender.siae_detail_contact_click_since_last_seen_date_count_annotated|pluralize:"x" }} prestataire{{ tender.siae_detail_contact_click_since_last_seen_date_count_annotated|pluralize }} intéressé{{ tender.siae_detail_contact_click_since_last_seen_date_count_annotated|pluralize }} 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 %}