'Like assertEqual except use ndiff for readable output.'

def ndiffAssertEqual(self, first, second):

    if (first != second):
        sfirst = str(first)
        ssecond = str(second)
        diff = difflib.ndiff(sfirst.splitlines(), ssecond.splitlines())
        fp = StringIO()
        print >>fp, NL, NL.join(diff)
        raise self.failureException, fp.getvalue()
