diff --git a/lacommunaute/surveys/tests/test_views.py b/lacommunaute/surveys/tests/test_views.py index e7aa6e50d..a299d44bf 100644 --- a/lacommunaute/surveys/tests/test_views.py +++ b/lacommunaute/surveys/tests/test_views.py @@ -1,6 +1,6 @@ from django.test import override_settings from django.urls import reverse -from pytest_django.asserts import assertContains, assertNotContains +from pytest_django.asserts import assertContains from lacommunaute.forum.factories import CategoryForumFactory from lacommunaute.surveys.factories import DSPFactory @@ -21,22 +21,13 @@ ] location_field_list = ["location", "city_code"] -form_html = '
' -login_with_next_url = reverse("users:login") + "?next=" + reverse("surveys:dsp_create") - class TestDSPCreateView: - def test_user_is_not_authenticated(self, db, client): + def test_action_box(self, db, client, snapshot): url = reverse("surveys:dsp_create") response = client.get(url) - assertContains(response, login_with_next_url) - assertNotContains(response, form_html) - - def test_user_is_authenticated(self, db, client): - client.force_login(UserFactory()) - response = client.get(reverse("surveys:dsp_create")) - assertContains(response, form_html) - assertNotContains(response, login_with_next_url) + content = parse_response_to_soup(response, selector="#action-box") + assert str(content) == snapshot(name="action_box") def test_form_fields(self, db, client): url = reverse("surveys:dsp_create") diff --git a/lacommunaute/templates/event/event_archive_month.html b/lacommunaute/templates/event/event_archive_month.html index 1a276b99f..d15490ade 100644 --- a/lacommunaute/templates/event/event_archive_month.html +++ b/lacommunaute/templates/event/event_archive_month.html @@ -7,6 +7,7 @@ {% trans "Events" %} {{ month }} {% endblock sub_title %} {% block content %} + {% url 'event:create' as create_url %}
@@ -55,13 +56,41 @@

-
+
-
-
- {% trans "Post a new Public Event" %} + {% if user.is_authenticated %} +
+
+
+
+
+ Je suis l'organisateur d'un évènement à destination des CIP pour les aider à améliorer leur pratique professionnelle ? +
+ J'ajoute un évènement public dans le calendrier de la communauté +
+ +
+
+
-
+ {% else %} +
+
+
+
+
+ Je suis l'organisateur d'un évènement à destination des CIP pour les aider à améliorer leur pratique professionnelle ? +
+ Je me connecte pour ajouter un évènement public dans le calendrier de la communauté +
+
{% include "registration/includes/login_link.html" with next=create_url %}
+
+
+
+
+ {% endif %}
{% endblock content %} diff --git a/lacommunaute/templates/forum_conversation/topics_public.html b/lacommunaute/templates/forum_conversation/topics_public.html index 50897b217..262fdcbc9 100644 --- a/lacommunaute/templates/forum_conversation/topics_public.html +++ b/lacommunaute/templates/forum_conversation/topics_public.html @@ -43,14 +43,16 @@