Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix nondeterministic category test

IKarbowiak238457c4c5ca
diff --git a/tests/api/test_category.py b/tests/api/test_category.py
index e3856b8aaa..76a0cdd0e8 100644
--- a/tests/api/test_category.py
+++ b/tests/api/test_category.py
@@ -402,9 +402,12 @@ def test_category_delete_mutation_for_categories_tree(
with pytest.raises(parent._meta.model.DoesNotExist):
parent.refresh_from_db()
- mock_update_products_minimal_variant_prices_task.delay.assert_called_once_with(
- product_ids=[p.pk for p in product_list]
- )
+ mock_update_products_minimal_variant_prices_task.delay.assert_called_once()
+ (
+ _call_args,
+ call_kwargs,
+ ) = mock_update_products_minimal_variant_prices_task.delay.call_args
+ assert set(call_kwargs["product_ids"]) == set(p.pk for p in product_list)
for product in product_list:
product.refresh_from_db()