aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests/test_edit.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2014-09-16 17:36:52 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2014-09-16 17:39:53 -0500
commit6430ae97eca57f4db4bcef54436df6c2abcd21ad (patch)
treed290df644859a27562bf2751298114d1572a5b13 /mediagoblin/tests/test_edit.py
parent1db2bd3fe745d0914264406a0090efc6d81244f4 (diff)
downloadmediagoblin-6430ae97eca57f4db4bcef54436df6c2abcd21ad.tar.lz
mediagoblin-6430ae97eca57f4db4bcef54436df6c2abcd21ad.tar.xz
mediagoblin-6430ae97eca57f4db4bcef54436df6c2abcd21ad.zip
Last two issues related to the python 3 merge tests: fixed!
- Fix the "pulling the error out of excinfo" stuff for py3 - The u"" only gets embedded in the string on py2. This commit sponsored by Jeff Gibson. Thanks, Jeff! :)
Diffstat (limited to 'mediagoblin/tests/test_edit.py')
-rw-r--r--mediagoblin/tests/test_edit.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/mediagoblin/tests/test_edit.py b/mediagoblin/tests/test_edit.py
index 547b382e..384929cb 100644
--- a/mediagoblin/tests/test_edit.py
+++ b/mediagoblin/tests/test_edit.py
@@ -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