From 613cf1546a3d7114077bb1831fc0f442a2c0c4c6 Mon Sep 17 00:00:00 2001 From: ClemRiviere Date: Tue, 14 Apr 2020 17:33:09 +0200 Subject: [PATCH] Adding unit tests --- modoboa/core/tests/test_views.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modoboa/core/tests/test_views.py b/modoboa/core/tests/test_views.py index 9f7b24787..f4cb7cbc5 100644 --- a/modoboa/core/tests/test_views.py +++ b/modoboa/core/tests/test_views.py @@ -4,6 +4,7 @@ from testfixtures import compare from django import forms from django.urls import reverse +from django.test import override_settings from modoboa.lib.tests import ModoTestCase from modoboa.parameters import forms as param_forms, tools as param_tools @@ -159,6 +160,20 @@ class DashboardTestCase(ModoTestCase): response = self.client.get(url) self.assertNotContains(response, "Features looking for sponsoring") + @override_settings(DISABLE_RSS=False) + def test_enable_rss(self): + """Load dashboard with DISABLE_RSS = False""" + url = reverse("core:dashboard") + response = self.client.get(url) + self.assertContains(response, 'href="https://modoboa.org/en/weblog/') + + @override_settings(DISABLE_RSS=True) + def test_disable_rss(self): + """Load dashboard with DISABLE_RSS = True""" + url = reverse("core:dashboard") + response = self.client.get(url) + self.assertNotContains(response, 'https://modoboa.org/en/weblog/') + def test_root_dispatch(self): """Check root dispatching.""" url = reverse("core:root")