'Failures while applying a diff emit a log message containing the full
diff.'

@capture_logging(assertHasMessage, DIFF_COMMIT_ERROR)
def test_error_logging(self, logger):

    o1 = DiffTestObjInvariant(a=1, b=2)
    patcher = MonkeyPatcher()
    patcher.addPatch(DiffTestObjInvariant, '_perform_invariant_check', False)
    patcher.patch()
    try:
        o2 = o1.set('b', 1)
    finally:
        patcher.restore()
    diff = create_diff(o1, o2)
    self.assertRaises(InvariantException, diff.apply, o1)
