mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
Adding unit tests
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user