def test_cache_tree_children_with_invalid_ordering(self):

        with self.assertNumQueries(1):
            with self.assertRaises(ValueError):
                cache_tree_children(list(Category.objects.order_by('-id')))

        # Passing a list with correct ordering should work, though.
        with self.assertNumQueries(1):
            cache_tree_children(list(Category.objects.all()))

        # The exact ordering tuple doesn't matter, long as the nodes end up in depth-first order.
        cache_tree_children(Category.objects.order_by('tree_id', 'lft', 'name'))
        cache_tree_children(Category.objects.filter(tree_id=1).order_by('lft'))
Ensures that ``cache_tree_children`` fails with a ``ValueError`` when
dataset/ETHPy150Open django-mptt/django-mptt/tests/myapp/tests.py/CacheTreeChildrenTestCase.test_cache_tree_children_with_invalid_ordering