I\'m writing a reusable django app and I need to ensure that its models are only sync\'ed when the app is in test mode. I\'ve tried to use a custom DjangoTestRunner, but I f
Well, you can just simply use environment variables in this way:
export MYAPP_TEST=1 && python manage.py test
then in your settings.py file:
settings.py
import os TEST = os.environ.get('MYAPP_TEST') if TEST: # Do something