

def test_sort_object_in_context(self):
    'Places Sort object in context as "sort".'
    req = RequestFactory().get('/a/url', {
        'sortfield': 'name',
        'sortdirection': 'desc',
    })
    res = res.on_template_response({
        'ctx_name': Mock(),
    }, request=req)
    sort = res.context_data['sort']
    self.assertEqual(sort.field, 'name')
    self.assertEqual(sort.direction, 'desc')

dataset/ETHPy150Open mozilla/moztrap/tests/view/lists/test_sort.py SortDecoratorTest.test_sort_object_in_context/VarMisuse@39/75 `self`->`res`