2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-05-28 03:49:20 +00:00

Fix isInTestMode check

This commit is contained in:
Oliver Walters
2026-05-23 05:49:44 +00:00
parent f932ed0cda
commit 937c237d98
2 changed files with 4 additions and 2 deletions
@@ -20,7 +20,7 @@ v491 -> 2026-05-21 : https://github.com/inventree/InvenTree/pull/11979
- Add API serializer for deleting a stock location - Add API serializer for deleting a stock location
v490 -> 2026-05-19 : https://github.com/inventree/InvenTree/pull/11963 v490 -> 2026-05-19 : https://github.com/inventree/InvenTree/pull/11963
- moves user-self-filtered endpoints to /user/me/ to make their security boundaries clearer - Moves user-self-filtered endpoints to /user/me/ to make their security boundaries clearer
v489 -> 2026-05-18 : https://github.com/inventree/InvenTree/pull/11962 v489 -> 2026-05-18 : https://github.com/inventree/InvenTree/pull/11962
- Removes the "remote_image" field from the Part API endpoint - Removes the "remote_image" field from the Part API endpoint
+3 -1
View File
@@ -37,7 +37,9 @@ def isAppLoaded(app_name: str) -> bool:
def isInTestMode(): def isInTestMode():
"""Returns True if the database is in testing mode.""" """Returns True if the database is in testing mode."""
return any(x in sys.argv for x in ['test', 'pytest']) return any(x in sys.argv for x in ['test', 'pytest']) or sys.argv[0].endswith(
'pytest'
)
def isWaitingForDatabase(): def isWaitingForDatabase():