Skip to content

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

Fix non deterministic tests

Adam Janikeefd4c7dba74
diff --git a/tests/dashboard/test_graphql.py b/tests/dashboard/test_graphql.py
index 5e5b89ccf4..dada4baf62 100644
--- a/tests/dashboard/test_graphql.py
+++ b/tests/dashboard/test_graphql.py
@@ -354,9 +354,11 @@ def test_create_product(
assert data['product']['isPublished'] == product_isPublished
assert data['product']['productType']['name'] == product_type.name
assert data['product']['category']['name'] == default_category.name
- assert data['product']['attributes'][1]['value'] == slugify(
- non_existent_attr_value)
- assert data['product']['attributes'][0]['value'] == color_value_slug
+ values = (
+ data['product']['attributes'][0].get('value'),
+ data['product']['attributes'][1].get('value'))
+ assert slugify(non_existent_attr_value) in values
+ assert color_value_slug in values
def test_update_product(