aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2014-09-16 15:25:30 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2014-09-16 15:25:30 -0500
commitdd41141d238c6b9329c5250429cec50f0e174246 (patch)
treebb4e7e263a4f2ef00ec04ed8b4509a08635ce521
parent16450dada24dec2819c6067768af54b0d9b91402 (diff)
downloadmediagoblin-dd41141d238c6b9329c5250429cec50f0e174246.tar.lz
mediagoblin-dd41141d238c6b9329c5250429cec50f0e174246.tar.xz
mediagoblin-dd41141d238c6b9329c5250429cec50f0e174246.zip
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!
-rw-r--r--mediagoblin/tests/test_edit.py6
1 files changed, 4 insertions, 2 deletions
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"&#39;On the worst day&#39; is not a &#39;date-time&#39;" 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'"