Currently, this line is used to check whether to use the mock Airtable API in place of the real one:
TESTING = any(x in ["test", "runtests.py"] for x in sys.argv)
I spent far too long wondering why my tests were failing locally, because I was invoking them with python ./runtests.py (which doesn't match the above test) instead of python runtests.py.
This change makes this more robust, by introducing an explicit WAGTAIL_AIRTABLE_TESTING variable in settings - so the mock will be used any time the tests.settings settings module is active.
Currently, this line is used to check whether to use the mock Airtable API in place of the real one:
I spent far too long wondering why my tests were failing locally, because I was invoking them with
python ./runtests.py
(which doesn't match the above test) instead ofpython runtests.py
.This change makes this more robust, by introducing an explicit
WAGTAIL_AIRTABLE_TESTING
variable in settings - so the mock will be used any time thetests.settings
settings module is active.