Turning off signals dispatch when testing units
Model signals pre_save and post_save will be turned off when running unit tests because they are interfering with the tests.remotes/origin/enhancement/email-actions
parent
9bca29ce20
commit
55f5c70e4e
|
@ -0,0 +1,10 @@
|
|||
from django.db.models import signals
|
||||
|
||||
|
||||
def disconnect_signals():
|
||||
signals.pre_save.receivers = []
|
||||
signals.post_save.receivers = []
|
||||
|
||||
|
||||
def pytest_runtest_setup(item):
|
||||
disconnect_signals()
|
Loading…
Reference in New Issue