Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandgeider committed Nov 9, 2024
1 parent 007712f commit 671bd8e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions wger/nutrition/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,21 @@ def test_download_ingredient_off(self, mock_logger, mock_from_json, mock_request
):
result = fetch_ingredient_image(1)

# log1 = mock_logger.mock_calls[0]
# print(log1)
mock_logger.assert_any_call('Fetching image for ingredient 1')
mock_logger.assert_any_call(
'Trying to fetch image from OFF for Test ingredient 1 (UUID: '
'7908c204-907f-4b1e-ad4e-f482e9769ade)'
)
mock_logger.assert_any_call('Image successfully saved')

# print(mock_request.mock_calls)
mock_request.assert_any_call(
'https://world.openfoodfacts.org/api/v2/product/5055365635003.json?fields=images,image_front_url',
headers=wger_headers(),
timeout=ANY,
)
mock_request.assert_any_call(
'https://openfoodfacts-images.s3.eu-west-3.amazonaws.com/data/123/456/789/0987/654321/12345.jpg',
'https://openfoodfacts-images.s3.eu-west-3.amazonaws.com/data/123/456/789/0987654321/12345.jpg',
headers=wger_headers(),
)
mock_from_json.assert_called()
Expand Down

0 comments on commit 671bd8e

Please sign in to comment.