So I have various signals and handlers which are sent across apps. However, when I perform tests / go into 'testing mode', I want these handlers to be disabled.
Is there a Django-specific way of disabling signals/handlers when in testing mode? I can think of a very simple way (of including the handlers within an if TESTING clause) but I was wondering if there was a better way built into Django?...
No, there is not. You can easily make a conditional connection though:
import sys
if not 'test' in sys.argv:
signal.connect(listener, sender=FooModel)