Beispiel #1
0
 def get_context_data(self, **kwargs):
     context = super(DashboardView, self).get_context_data(**kwargs)
     context["notifications"] = notifications = []
     context["blocks"] = blocks = []
     for module in get_modules():
         notifications.extend(module.get_notifications(request=self.request))
         blocks.extend(module.get_dashboard_blocks(request=self.request))
     context["activity"] = get_activity(request=self.request)
     return context
Beispiel #2
0
 def get_context_data(self, **kwargs):
     context = super(DashboardView, self).get_context_data(**kwargs)
     context["notifications"] = notifications = []
     context["blocks"] = blocks = []
     for module in get_modules():
         notifications.extend(module.get_notifications(request=self.request))
         blocks.extend(module.get_dashboard_blocks(request=self.request))
     context["activity"] = get_activity(request=self.request)
     return context
Beispiel #3
0
def test_activity(rf):
    with replace_modules([TestModule]):
        request = rf.get("/")
        texts = [a.text for a in get_activity(request, 10)]
        # Check that activity is returned in newest-first order.
        assert texts == ["Latest", "Later", "Earlier", "Earliest" ]
Beispiel #4
0
def test_activity(rf):
    with replace_modules([ATestModule]):
        request = rf.get("/")
        texts = [a.text for a in get_activity(request, 10)]
        # Check that activity is returned in newest-first order.
        assert texts == ["Latest", "Later", "Earlier", "Earliest" ]