Python 2&3 compatible unicode string assert equality
<p>I have some code that returns <code>repr</code>'s of Exceptions. It needs to run on Python 2 and Python 3.</p>

<p>A very dumbed-down version of the code is as follows:</p>

<pre><code>from __future__ import unicode_literals

class Foo:
    def bar(self):
        return repr(Exception('bar'))
</code></pre>

<p>The problem is with testing the code above. </p>

<p>Python 3.5:</p>

<pre><code>foo = Foo()
assert foo.bar() == "Exception('bar',)"
# true
</code></pre>

<p>Python 2.7:</p>

<pre><code>foo = Foo()
assert foo.bar() == "Exception('bar',)"
# false because foo.bar() returns "Exception(u'bar',)",
# note the ``u`` before the first ``'``
</code></pre>

<p>Is there an elegant way to ignore that <code>u</code> when asserting equality of two strings? I'm using unittest2.</p>