'Assert that two multi-line strings are equal.'

def assertMultiLineEqual(self, first, second, msg=None):

    self.assertIsInstance(first, basestring, 'First    argument    is    not    a    string')
    self.assertIsInstance(second, basestring, 'Second    argument    is    not    a    string')
    if (first != second):
        if ((len(first) > self._diffThreshold) or (len(second) > self._diffThreshold)):
            self._baseAssertEqual(first, second, msg)
        firstlines = first.splitlines(True)
        secondlines = second.splitlines(True)
        if ((len(firstlines) == 1) and (first.strip('\r\n') == first)):
            firstlines = [(first + '\n')]
            secondlines = [(second + '\n')]
        standardMsg = ('%s    !=    %s' % (safe_repr(first, True), safe_repr(second, True)))
        diff = ('\n' + ''.join(difflib.ndiff(firstlines, secondlines)))
        standardMsg = self._truncateMessage(standardMsg, diff)
        self.fail(self._formatMessage(msg, standardMsg))
