

def test_sort_defaults(self):
    'Decorator factory accepts default sort field and direction.'
    dec = self.sort('ctx_name', defaultfield='name', defaultdirection='desc')
    qs = Mock()
    self.on_template_response({
        'ctx_name': qs,
    }, decorator=dec)
    dec.order_by.assert_called_with('-name')

dataset/ETHPy150Open mozilla/moztrap/tests/view/lists/test_sort.py SortDecoratorTest.test_sort_defaults/VarMisuse@53/90 `qs`->`dec`