def assertExceptionContains(self, text, callableObj, *args, **kwargs):
    try:
        callableObj(*args, **kwargs)
    except Exception as e:
        if (text not in str(e)):
            raise self.failureException(('Exception %(e)r raised, it should contain the text %(text)r and does not' % locals()))
    else:
        raise self.failureException(('Exception containing %(text)r not raised' % locals()))
def assertExceptionContains(self, text, callableObj, *args, **kwargs):
    try:
        callableObj(*args, **kwargs)
    except Exception as e:
        if (text not in str(e)):
            raise self.failureException(('Exception %(e)r raised, it should contain the text %(text)r and does not' % locals()))
    else:
        raise self.failureException(('Exception containing %(text)r not raised' % locals()))