def test_category_detail_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:category:detail', kwargs={'pk': category.pk,
                                                                             'slug': category.slug}))
        self.assertEqual(list(response.context['topics']), [topic_d, topic_b, topic_c, topic_a])
Delete all group entries.
dataset/ETHPy150Open nitely/Spirit/spirit/category/tests.py/CategoryViewTest.test_category_detail_view_pinned--crossover with--dataset/ETHPy150Open osrg/ryu/ryu/tests/switch/tester.py/OpenFlowSw.del_groups