Skip to content

Commit

Permalink
fix: fix issue in settings (DISABLE_PRODUCT_CHECK value)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Apr 10, 2023
1 parent 8dd914f commit 232e5c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion robotoff/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,4 @@ def init_sentry(integrations: Optional[list[Integration]] = None):
# - when importing a new image through a webhook call (in robotoff.workers.tasks.import_image)
# This is useful when testing locally, as we don't need the product to be in MongoDB to import
# an image and generate insights.
DISABLE_PRODUCT_CHECK = bool(os.environ.get("DISABLE_PRODUCT_CHECK", 0))
DISABLE_PRODUCT_CHECK = bool(int(os.environ.get("DISABLE_PRODUCT_CHECK", 0)))
5 changes: 5 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
from robotoff.taxonomy import Taxonomy


@pytest.fixture(autouse=True)
def set_global_settings(mocker):
mocker.patch("robotoff.settings.DISABLE_PRODUCT_CHECK", False)


@pytest.fixture(scope="session", autouse=True)
def disable_redis_lock():
previous_value = Lock._enabled
Expand Down

0 comments on commit 232e5c6

Please sign in to comment.