

def test_bad_sort_field(self):
    'Silently ignores bad sort field.'
    req = RequestFactory().get('/a/url', {
        'sortfield': 'foo',
        'sortdirection': 'asc',
    })
    from moztrap.model.core.models import Product
    qs = Product.objects.all()
    res = self.on_template_response({
        'ctx_name': qs,
    }, request=req)
    self.assertEqual(list(res.context_data['ctx_name']), [])

dataset/ETHPy150Open mozilla/moztrap/tests/view/lists/test_sort.py SortDecoratorTest.test_bad_sort_field/original