New unit test.

This commit is contained in:
Antoine Nguyen
2016-11-25 17:17:38 +01:00
parent 2393b8a0d8
commit 3f4551b7f3
2 changed files with 10 additions and 3 deletions
+9
View File
@@ -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."""
+1 -3
View File
@@ -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(