def test_topic_notification_list_show_private_topic(self):
        TopicNotification.objects.all().delete()

        topic_a = utils.create_private_topic(user=self.user)
        topic_notif = TopicNotification.objects.create(user=self.user, topic=topic_a.topic,
                                                       comment=self.comment, is_active=True, action=COMMENT)

        utils.login(self)
        response = self.client.get(reverse('spirit:topic:notification:index'))
        self.assertEqual(list(response.context['notifications']), [topic_notif, ])

        # list unread should behave the same
        response = self.client.get(reverse('spirit:topic:notification:index-unread'))
        self.assertEqual(list(response.context['page']), [topic_notif, ])

        # ajax list should behave the same
        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)
Handle client connection
dataset/ETHPy150Open nitely/Spirit/spirit/topic/notification/tests.py/TopicNotificationViewTest.test_topic_notification_list_show_private_topic--crossover with--dataset/ETHPy150Open veegee/guv/guv/support/gunicorn_worker.py/AsyncWorker.handle