def test_topic_notification_ajax(self):
        utils.login(self)
        response = self.client.get(reverse('spirit:topic:notification:index-ajax'),
                                   HTTP_X_REQUESTED_WITH='XMLHttpRequest')
        res = json.loads(response.content.decode('utf-8'))
        self.assertEqual(len(res['n']), 1)
        expected = {
            'user': self.topic_notification.comment.user.username,
            'action': self.topic_notification.action,
            'title': self.topic_notification.comment.topic.title,
            'url': self.topic_notification.get_absolute_url(),
            'is_read': self.topic_notification.is_read
        }
        self.assertDictEqual(res['n'][0], expected)
        self.assertFalse(TopicNotification.objects.get(pk=self.topic_notification.pk).is_read)
get notifications
dataset/ETHPy150Open nitely/Spirit/spirit/topic/notification/tests.py/TopicNotificationViewTest.test_topic_notification_ajax