'error() includes traceback in message if exceptions logging is on'

@mock_streams('stdout')
@with_patched_object(utils, 'abort', Fake('abort', callable=True, expect_call=True).calls((lambda x: sys.stdout.write((x + '\n')))))
@with_patched_object(output, 'exceptions', True)
@with_patched_object(utils, 'format_exc', Fake('format_exc', callable=True, expect_call=True).returns(dummy_string))
def test_includes_traceback_if_exceptions_logging_is_on(self):

    error('error    message', func=utils.abort, stdout=error)
    assert_contains(self.dummy_string, sys.stdout.getvalue())
