From: Christopher Allan Webber Date: Tue, 16 Sep 2014 20:25:30 +0000 (-0500) Subject: Much more nicely formed form error check X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=dd41141d238c6b9329c5250429cec50f0e174246;p=mediagoblin.git Much more nicely formed form error check This doesn't rely on checking HTML output... thus, cleaner. This commit sponsored by Alexandre Guédon. Thank you! --- diff --git a/mediagoblin/tests/test_edit.py b/mediagoblin/tests/test_edit.py index e34ca27a..547b382e 100644 --- a/mediagoblin/tests/test_edit.py +++ b/mediagoblin/tests/test_edit.py @@ -250,5 +250,7 @@ class TestMetaDataEdit: old_metadata = new_metadata new_metadata = media_entry.media_metadata assert new_metadata == old_metadata - assert (b"'On the worst day' is not a 'date-time'" in - response.body) + 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'"