def test_category_detail_view_order(self):
        topic_a = utils.create_topic(category=self.category_1, is_pinned=True)
        topic_b = utils.create_topic(category=self.category_1)
        utils.create_topic(category=self.category_1, is_pinned=True, is_removed=True)
        # show pinned first
        Topic.objects.filter(pk=topic_a.pk).update(last_active=timezone.now() - datetime.timedelta(days=10))

        response = self.client.get(reverse('spirit:category:detail', kwargs={'pk': self.category_1.pk,
                                                                             'slug': self.category_1.slug}))
        self.assertEqual(list(response.context['topics']), [topic_a, topic_b, ])
should display all topics order by pinned and last active
dataset/ETHPy150Open nitely/Spirit/spirit/category/tests.py/CategoryViewTest.test_category_detail_view_order