def test_topic_active_view_pinned(self):
        category = utils.create_category()
        topic_a = utils.create_topic(category=category)
        topic_b = utils.create_topic(category=category, is_pinned=True)
        topic_c = utils.create_topic(category=category)
        topic_d = utils.create_topic(category=category, is_globally_pinned=True)
        # show globally pinned first
        Topic.objects.filter(pk=topic_d.pk).update(last_active=timezone.now() - datetime.timedelta(days=10))

        response = self.client.get(reverse('spirit:topic:index-active'))
        self.assertEqual(list(response.context['topics']), [topic_d, topic_c, topic_b, topic_a])
Show globally pinned topics first, regular pinned topics are shown as regular topics
dataset/ETHPy150Open nitely/Spirit/spirit/topic/tests.py/TopicViewTest.test_topic_active_view_pinned