Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Jan 29, 2024
1 parent e466770 commit 3a0c0c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions lemarche/templates/tenders/_detail_sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
</p>
</div>
{% elif siae_has_detail_contact_click_date %}
{# contact info displayed in _detail_contact.html #}
{% elif siae_has_detail_cocontracting_click_date %}
{% include "tenders/_detail_cocontracting_click_confirm.html" %}
{% elif siae_has_detail_not_interested_click_date %}
Expand All @@ -63,6 +64,7 @@
<!-- anonymous user but siae_id in url -->
{% elif siae_id %}
{% if siae_has_detail_contact_click_date %}
{# contact info displayed in _detail_contact.html #}
{% elif siae_has_detail_cocontracting_click_date %}
{% include "tenders/_detail_cocontracting_click_confirm.html" %}
{% elif siae_has_detail_not_interested_click_date %}
Expand Down
16 changes: 8 additions & 8 deletions lemarche/www/tenders/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -847,39 +847,39 @@ def test_tender_contact_display(self):
self.assertNotContains(response, "Clôturé")
self.assertContains(response, "Voir l'appel d'offres")
self.assertContains(response, "Répondre en co-traitance ?")
self.assertContains(response, "Je ne suis pas intéressé")
self.assertContains(response, "Cette demande ne vous intéresse pas ?")
# siae user interested
self.client.force_login(self.siae_user_1)
url = reverse("tenders:detail", kwargs={"slug": self.tender_1.slug})
response = self.client.get(url)
self.assertContains(response, "Contactez le client dès maintenant")
self.assertNotContains(response, "Voir l'appel d'offres")
self.assertNotContains(response, "Répondre en co-traitance ?")
self.assertNotContains(response, "Je ne suis pas intéressé")
self.assertNotContains(response, "Cette demande ne vous intéresse pas ?")
# siae user cocontracting
self.client.force_login(self.siae_user_4)
url = reverse("tenders:detail", kwargs={"slug": self.tender_1.slug})
response = self.client.get(url)
self.assertNotContains(response, "Contactez le client dès maintenant")
self.assertNotContains(response, "Voir l'appel d'offres") # TODO: fix
self.assertNotContains(response, "Répondre en co-traitance ?")
self.assertNotContains(response, "Je ne suis pas intéressé")
self.assertNotContains(response, "Cette demande ne vous intéresse pas ?")
# siae user not interested
self.client.force_login(self.siae_user_5)
url = reverse("tenders:detail", kwargs={"slug": self.tender_1.slug})
response = self.client.get(url)
self.assertNotContains(response, "Contactez le client dès maintenant")
self.assertNotContains(response, "Voir l'appel d'offres")
self.assertNotContains(response, "Répondre en co-traitance ?")
self.assertNotContains(response, "Je ne suis pas intéressé")
self.assertNotContains(response, "Cette demande ne vous intéresse pas ?")
self.assertContains(response, "Vous n'êtes pas intéressé par ce besoin")
# siae user not concerned
self.client.force_login(self.siae_user_6)
url = reverse("tenders:detail", kwargs={"slug": self.tender_1.slug})
response = self.client.get(url)
self.assertContains(response, "Voir l'appel d'offres")
self.assertContains(response, "Répondre en co-traitance ?")
self.assertContains(response, "Je ne suis pas intéressé")
self.assertContains(response, "Cette demande ne vous intéresse pas ?")
self.assertNotContains(response, "Vous n'êtes pas intéressé par ce besoin")
# siae user without siae
self.client.force_login(self.siae_user_without_siae)
Expand All @@ -888,15 +888,15 @@ def test_tender_contact_display(self):
self.assertContains(response, "veuillez d'abord vous")
self.assertNotContains(response, "Voir l'appel d'offres")
self.assertNotContains(response, "Répondre en co-traitance ?")
self.assertNotContains(response, "Je ne suis pas intéressé")
self.assertNotContains(response, "Cette demande ne vous intéresse pas ?")
# author
self.client.force_login(self.user_buyer_1)
url = reverse("tenders:detail", kwargs={"slug": self.tender_1.slug})
response = self.client.get(url)
self.assertContains(response, "Coordonnées")
self.assertNotContains(response, "Voir l'appel d'offres")
self.assertNotContains(response, "Répondre en co-traitance ?")
self.assertNotContains(response, "Je ne suis pas intéressé")
self.assertNotContains(response, "Cette demande ne vous intéresse pas ?")

def test_tender_response_is_anonymous_contact_display(self):
# anonymous user
Expand All @@ -918,7 +918,7 @@ def test_tender_response_is_anonymous_contact_display(self):
self.assertNotContains(response, "Contactez le client dès maintenant")
self.assertNotContains(response, "Voir l'appel d'offres") # TODO: fix
self.assertNotContains(response, "Répondre en co-traitance ?")
self.assertNotContains(response, "Je ne suis pas intéressé")
self.assertNotContains(response, "Cette demande ne vous intéresse pas ?")
# siae user not interested
self.client.force_login(self.siae_user_5)
url = reverse("tenders:detail", kwargs={"slug": self.tender_3_response_is_anonymous.slug})
Expand Down

0 comments on commit 3a0c0c1

Please sign in to comment.