def test_audit_post_delete_signal_is_added(self): """ SUPPLIER MODEL SHOULD NOT BE AUDITED. CONTACT MODEL IS. """ live_receivers = audit_post_delete._live_receivers(Supplier) found = False for receiver in live_receivers: if str(receiver) == "<bound method AuditMixin.post_delete of <class 'purchases.models.Supplier'>>": found = True break if found: self.fail( "Failed to find the post_delete method of the AuditMixin class")
def test_audit_post_delete_signal_is_added(self): """ After registering the model and disconnecting the receiver from the post delete signal we add our receiver to a custom signal """ live_receivers = audit_post_delete._live_receivers(Contact) found = False for receiver in live_receivers: if str(receiver) == "<bound method AuditMixin.post_delete of <class 'contacts.models.Contact'>>": found = True break if not found: self.fail("Failed to find the post_delete method of the AuditMixin class")