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!
This commit is contained in:
Christopher Allan Webber 2014-09-16 15:25:30 -05:00
parent 16450dada2
commit dd41141d23

View File

@ -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'"