mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-19 05:58:34 +02:00
New unit test.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
"""Core views test cases."""
|
||||
|
||||
import json
|
||||
|
||||
from testfixtures import compare
|
||||
|
||||
from django import forms
|
||||
@@ -67,6 +69,13 @@ class DashboardTestCase(ModoTestCase):
|
||||
self.assertEqual(response.status_code, 302)
|
||||
self.assertTrue(response.url.endswith(reverse("core:dashboard")))
|
||||
|
||||
def test_top_notifications(self):
|
||||
"""Check top notifications service."""
|
||||
url = reverse("core:top_notifications_check")
|
||||
response = self.client.get(url)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(len(json.loads(response.content)), 1)
|
||||
|
||||
|
||||
class SettingsTestCase(ModoTestCase):
|
||||
"""Settings tests."""
|
||||
|
||||
@@ -114,9 +114,7 @@ def logs_page(request, tplname="core/logs_page.html"):
|
||||
|
||||
@login_required
|
||||
def check_top_notifications(request):
|
||||
"""
|
||||
AJAX service to check for new top notifications to display.
|
||||
"""
|
||||
"""AJAX service to check for new top notifications to display."""
|
||||
notifications = signals.get_top_notifications.send(
|
||||
sender="top_notifications", include_all=True)
|
||||
notifications = reduce(
|
||||
|
||||
Reference in New Issue
Block a user