def test_sort_by_status(self):
        self.factory(tester__username="Tester 1", status="passed")
        self.factory(tester__username="Tester 2", status="failed")

        res = self.get(
            params={"sortfield": "status", "sortdirection": "asc"})

        self.assertOrderInList(res, "Tester 2", "Tester 1")
Can sort by status.
dataset/ETHPy150Open mozilla/moztrap/tests/view/results/results/test_views.py/ResultsViewTest.test_sort_by_status