-
+
-
diff --git a/loko/notifications/templates/notifications/discussion_detail.html b/loko/notifications/templates/notifications/discussion_detail.html
index bb3292d..5e9a372 100644
--- a/loko/notifications/templates/notifications/discussion_detail.html
+++ b/loko/notifications/templates/notifications/discussion_detail.html
@@ -183,9 +183,9 @@
{% for msg in thread_messages %}
{% if msg.is_system %}
-
- {{ msg.content }}
- ({{ msg.created_at|date:"d/m H:i" }})
+
+ {{ msg.content|safe }}
+ ({{ msg.created_at|date:"d/m H:i" }})
{% else %}
@@ -235,6 +235,7 @@
{% endif %}
+ {% endif %}
{% endfor %}
{% endif %}
diff --git a/loko/notifications/tests.py b/loko/notifications/tests.py
index 241d012..ba720b7 100644
--- a/loko/notifications/tests.py
+++ b/loko/notifications/tests.py
@@ -537,13 +537,13 @@ class DiscussionFlagTests(TestCase):
self.assertIsNotNone(msg)
self.assertTrue(msg.is_system)
self.assertIn("Alice Smith", msg.content)
- self.assertIn("🚩", msg.content)
+ self.assertIn("bi-flag-fill text-danger", msg.content)
# 2. Change to green flag
msg2 = set_discussion_flag(self.discussion, 'green', user=self.user)
self.discussion.refresh_from_db()
self.assertEqual(self.discussion.flag, 'green')
- self.assertIn("🟩", msg2.content)
+ self.assertIn("bi-flag-fill text-success", msg2.content)
# 3. Setting same flag returns None and doesn't create new message
msg_noop = set_discussion_flag(self.discussion, 'green', user=self.user)
@@ -618,6 +618,13 @@ class DiscussionFlagTests(TestCase):
self.assertEqual(disc.flag, 'red')
self.assertEqual(disc.flag_set_by, self.user)
-
-
-
+ def test_discussion_detail_view_renders_template(self):
+ self.client.force_login(self.user)
+ from notifications.models import Message
+ Message.objects.create(discussion=self.discussion, author=self.user, content="Hello message")
+ Message.objects.create(discussion=self.discussion, author=self.user, content="🚩 System flag", is_system=True)
+ url = reverse('notifications:discussion_detail', args=[self.discussion.pk])
+ res = self.client.get(url)
+ self.assertEqual(res.status_code, 200)
+ self.assertContains(res, "Hello message")
+ self.assertContains(res, "System flag")
diff --git a/loko/observations/templates/observations/observation_detail.html b/loko/observations/templates/observations/observation_detail.html
index a3a3841..a1d5e20 100644
--- a/loko/observations/templates/observations/observation_detail.html
+++ b/loko/observations/templates/observations/observation_detail.html
@@ -855,8 +855,16 @@