Last two issues related to the python 3 merge tests: fixed!
[mediagoblin.git] / mediagoblin / tests / test_edit.py
index 547b382e2242c18ad3994c705ed8347962b6994a..384929cb6249fbcddbfff12a88c1ae99396487ce 100644 (file)
@@ -14,6 +14,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+import six
 import six.moves.urllib.parse as urlparse
 import pytest
 
@@ -252,5 +253,9 @@ class TestMetaDataEdit:
         assert new_metadata == old_metadata
         context = template.TEMPLATE_TEST_CONTEXT[
             'mediagoblin/edit/metadata.html']
-        assert context['form'].errors['media_metadata'][0]['identifier'][0] == \
-            "'On the worst day' is not a 'date-time'"
+        if six.PY2:
+            expected = "u'On the worst day' is not a 'date-time'"
+        else:
+            expected = "'On the worst day' is not a 'date-time'"
+        assert context['form'].errors[
+            'media_metadata'][0]['identifier'][0] == expected