Commit 02bcf2ec by Kálmán Viktor

dashboard: context_processor notifications test

parent f5c1f9cd
...@@ -736,3 +736,14 @@ class IndexViewTest(LoginMixin, TestCase): ...@@ -736,3 +736,14 @@ class IndexViewTest(LoginMixin, TestCase):
response = c.get("/dashboard/") response = c.get("/dashboard/")
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertTrue("nodes" in response.context) self.assertTrue("nodes" in response.context)
def test_context_processor_notifications(self):
c = Client()
self.login(c, "user1")
response = c.get("/dashboard/")
self.assertEqual(response.context['NEW_NOTIFICATIONS_COUNT'], 0)
self.u1.profile.notify("urgent", "dashboard/test_message.txt", )
response = c.get("/dashboard/")
self.assertEqual(response.context['NEW_NOTIFICATIONS_COUNT'], 1)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment