

def test_dictsort_complex_sorting_key(self):
    "\n        Since dictsort uses template.Variable under the hood, it can sort\n        on keys like 'foo.bar'.\n        "
    data = [{
        'foo': {
            'bar': 1,
            'baz': 'c',
        },
    }, {
        'foo': {
            'bar': 2,
            'baz': 'b',
        },
    }, {
        'foo': {
            'bar': 3,
            'baz': 'a',
        },
    }]
    sorted_data = dictsort(self, 'foo.baz')
    self.assertEqual([d['foo']['bar'] for d in sorted_data], [3, 2, 1])

dataset/ETHPy150Open django/django/tests/template_tests/filter_tests/test_dictsort.py FunctionTests.test_dictsort_complex_sorting_key/VarMisuse@83/161 `data`->`self`