diff --git a/back/boxtribute_server/cron/data_faking.py b/back/boxtribute_server/cron/data_faking.py index 7f175e9d4..52e08dab9 100644 --- a/back/boxtribute_server/cron/data_faking.py +++ b/back/boxtribute_server/cron/data_faking.py @@ -472,6 +472,8 @@ def _generate_products(self): 15: ["Inhalation device"], } baby_products = ["Shirts", "Jackets", "Trousers"] # category 8 + mass_measure_products = ["Rice", "Pasta", "Chickpeas", "Sugar", "Cereal"] + volume_measure_products = ["Sauce", "Milk", "Vegetable oil"] size_ranges = { "Underwear": 6, # Mixed sizes "Tights": 6, @@ -581,6 +583,20 @@ def _generate_products(self): ) enabled_standard_products[b].append(product) + for names, size_range_id in zip( + [mass_measure_products, volume_measure_products], [28, 29] + ): + for name in names: + product = create_custom_product( + category_id=11, + size_range_id=size_range_id, + gender=ProductGender.none, + base_id=b, + name=name, + price=self.fake.random_int(max=100), + user_id=self._user_id(b), + ) + self.products[b].append(product) # Delete a product to_be_deleted_product = create_custom_product( category_id=12, diff --git a/back/test/auth0_integration_tests/test_operations.py b/back/test/auth0_integration_tests/test_operations.py index 5da948e82..c8d4e4b59 100644 --- a/back/test/auth0_integration_tests/test_operations.py +++ b/back/test/auth0_integration_tests/test_operations.py @@ -56,7 +56,7 @@ def _assert_successful_request(*args, **kwargs): response = _assert_successful_request(auth0_client, query, field=resource) assert len(response) == count - for resource, count in zip(["beneficiaries", "products"], [469, 312]): + for resource, count in zip(["beneficiaries", "products"], [469, 344]): query = f"query {{ {resource} {{ totalCount }} }}" response = _assert_successful_request(auth0_client, query, field=resource) assert response["totalCount"] == count diff --git a/back/test/endpoint_tests/test_cron.py b/back/test/endpoint_tests/test_cron.py index 4b3074d8f..1493fb388 100644 --- a/back/test/endpoint_tests/test_cron.py +++ b/back/test/endpoint_tests/test_cron.py @@ -78,7 +78,7 @@ def test_reseed_db(cron_client, monkeypatch, mocker): query = "query { products { totalCount } }" response = assert_successful_request(cron_client, query) - assert response["totalCount"] == 8 + 76 * 4 # minimal seed + generated + assert response["totalCount"] == 8 + 84 * 4 # minimal seed + generated query = "query { transferAgreements { id } }" response = assert_successful_request(cron_client, query)