'Returns a casper test failure (in dictionary form) as a 3-tuple of
the form used by unittest.TestResult.addFailure.
Used to add failures to a casperjs TestCase.'

def casper_failure_to_unittest_failure(self, casper_failure, failure_class=AssertionError):

    fail_type = casper_failure['type']
    values = json.dumps(casper_failure['values'])
    desc = casper_failure['standard']
    if ('messgae' in casper_failure):
        desc = casper_failure['message']
    failure_msg = ('(%s)    %s:    %s' % (fail_type, desc, values))
    return (failure_class, failure_msg, [])
