diff --git a/website_sale_lazy_loading/tests/test_lazy_loading.py b/website_sale_lazy_loading/tests/test_lazy_loading.py index 47bea99..f56d571 100644 --- a/website_sale_lazy_loading/tests/test_lazy_loading.py +++ b/website_sale_lazy_loading/tests/test_lazy_loading.py @@ -25,11 +25,16 @@ class TestLazyLoading(HttpCase): cls.other_category = cls.env["product.public.category"].create( {"name": "Other Cat"} ) + # An explicit website_sequence keeps the shop order equal to the + # creation order: in a batch create every product gets the same default + # (MAX + 5, read before the insert) and the shop breaks the tie by + # `id desc`, which would list them backwards. cls.products = cls.env["product.template"].create( [ { "name": "Lazy Product %02d" % index, "list_price": 10.0 + index, + "website_sequence": index, "is_published": True, "public_categ_ids": [(6, 0, cls.category.ids)], }