From 1e2cb0e2596360af9d33e2447a00c7c69ba8fd55 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laur=C3=A9line=20Gu=C3=A9rin?= <zebuline@entrouvert.com>
Date: Fri, 20 May 2022 23:28:27 +0200
Subject: [PATCH 2/3] pricing: add publik-django-templatetags publik filters
 (#65361)

---
 .../manager_agenda_pricing_matrix_form.html   |  2 +-
 lingo/settings.py                             |  1 +
 tests/pricing/test_manager.py                 | 26 -------------------
 3 files changed, 2 insertions(+), 27 deletions(-)

diff --git a/lingo/pricing/templates/lingo/pricing/manager_agenda_pricing_matrix_form.html b/lingo/pricing/templates/lingo/pricing/manager_agenda_pricing_matrix_form.html
index db57510..9276f35 100644
--- a/lingo/pricing/templates/lingo/pricing/manager_agenda_pricing_matrix_form.html
+++ b/lingo/pricing/templates/lingo/pricing/manager_agenda_pricing_matrix_form.html
@@ -1,5 +1,5 @@
 {% extends "lingo/pricing/manager_agenda_pricing_detail.html" %}
-{% load i18n lingo %}
+{% load i18n %}
 
 {% block breadcrumb %}
 {{ block.super }}
diff --git a/lingo/settings.py b/lingo/settings.py
index 4a718f5..2b56862 100644
--- a/lingo/settings.py
+++ b/lingo/settings.py
@@ -91,6 +91,7 @@ TEMPLATES = [
                 'django.contrib.messages.context_processors.messages',
             ],
             'builtins': [
+                'publik_django_templatetags.publik.templatetags.publik',
                 'django.contrib.humanize.templatetags.humanize',
             ],
         },
diff --git a/tests/pricing/test_manager.py b/tests/pricing/test_manager.py
index eabc9a2..e282608 100644
--- a/tests/pricing/test_manager.py
+++ b/tests/pricing/test_manager.py
@@ -1048,7 +1048,6 @@ def test_detail_agenda_pricing_1_category(app, admin_user):
     assert resp.pyquery.find('table tr.pricing-row-crit-3-4 td')[0].text == '114.00'
 
 
-@pytest.mark.xfail(reason='lingo template tags library not yet implemented (for |get)')
 def test_edit_agenda_pricing_matrix_3_categories(app, admin_user):
     category1 = CriteriaCategory.objects.create(label='Cat 1')
     criteria11 = Criteria.objects.create(label='Crit 1-1', slug='crit-1-1', category=category1, order=1)
@@ -1192,18 +1191,8 @@ def test_edit_agenda_pricing_matrix_3_categories(app, admin_user):
         status=404,
     )
     app.get('/manage/pricing/agenda/%s/pricing/%s/matrix/edit/' % (agenda.pk, agenda_pricing.pk), status=404)
-    # wrong kind
-    for kind in ['meetings', 'virtual']:
-        agenda.kind = kind
-        agenda.save()
-        app.get(
-            '/manage/pricing/agenda/%s/pricing/%s/matrix/%s/edit/'
-            % (agenda.pk, agenda_pricing.pk, criteria11.slug),
-            status=404,
-        )
 
 
-@pytest.mark.xfail(reason='lingo template tags library not yet implemented (for |get)')
 def test_edit_agenda_pricing_matrix_2_categories(app, admin_user):
     category2 = CriteriaCategory.objects.create(label='Cat 2')
     criteria21 = Criteria.objects.create(label='Crit 2-1', slug='crit-2-1', category=category2, order=1)
@@ -1309,16 +1298,8 @@ def test_edit_agenda_pricing_matrix_2_categories(app, admin_user):
         % (agenda.pk, agenda_pricing.pk, criteria31.slug),
         status=404,
     )
-    # wrong kind
-    for kind in ['meetings', 'virtual']:
-        agenda.kind = kind
-        agenda.save()
-        app.get(
-            '/manage/pricing/agenda/%s/pricing/%s/matrix/edit/' % (agenda.pk, agenda_pricing.pk), status=404
-        )
 
 
-@pytest.mark.xfail(reason='lingo template tags library not yet implemented (for |get)')
 def test_edit_agenda_pricing_matrix_1_category(app, admin_user):
     category3 = CriteriaCategory.objects.create(label='Cat 3')
     criteria31 = Criteria.objects.create(label='Crit 3-1', slug='crit-3-1', category=category3, order=1)
@@ -1379,13 +1360,6 @@ def test_edit_agenda_pricing_matrix_1_category(app, admin_user):
         % (agenda.pk, agenda_pricing.pk, criteria31.slug),
         status=404,
     )
-    # wrong kind
-    for kind in ['meetings', 'virtual']:
-        agenda.kind = kind
-        agenda.save()
-        app.get(
-            '/manage/pricing/agenda/%s/pricing/%s/matrix/edit/' % (agenda.pk, agenda_pricing.pk), status=404
-        )
 
 
 def test_edit_agenda_pricing_matrix_empty(app, admin_user):
-- 
2.35.1

