def test_unregister_fail(self, settings, pre_delete, post_save, pre_save, logger, dynamic_import):
        settings.LOGGED_MODELS = ('audit_tools.audit.tests.TestClass', )
        pre_save.disconnect.side_effect = Exception('Test Exception')

        signals.unregister_models()

        self.assertEqual(logger.error.call_count, 1)
    def test_unregister_ok(self, settings, pre_delete, post_save, pre_save, logger, dynamic_import):
        settings.LOGGED_MODELS = ('audit_tools.audit.fail.FailClass', )

        signals.unregister_models()

        self.assertEqual(pre_save.disconnect.call_count, 1)
        self.assertEqual(post_save.disconnect.call_count, 1)
        self.assertEqual(pre_delete.disconnect.call_count, 1)
        self.assertEqual(logger.error.call_count, 0)