diff options
author | Joar Wandborg <git@wandborg.com> | 2011-11-30 21:21:39 +0100 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-12-31 10:32:52 -0600 |
commit | a246ccca69e863904718537f45a17d226b33a123 (patch) | |
tree | 599aad1e47d56bf064430f10cdb378c59e2437ce /mediagoblin/tests | |
parent | 992e4f80324e5e2d0079fd70cce9d4ad962f7047 (diff) | |
download | mediagoblin-a246ccca69e863904718537f45a17d226b33a123.tar.lz mediagoblin-a246ccca69e863904718537f45a17d226b33a123.tar.xz mediagoblin-a246ccca69e863904718537f45a17d226b33a123.zip |
ASCII media type support & fix a bug in file submission error handling
* Added ASCII media processing
* Added ASCII media display
* Added ASCII media type
Rebased from Joar Wandborg's ascii art branch (squashed to remove the
commits borrowing code of dubious license)
Fixed a bug in file submission error handling:
- Moved file-extension condition out of loop (what did it do there?)
- Updated file submission tests
- Changed error handling in file submission, should now report more
than absolutely necessary.
Diffstat (limited to 'mediagoblin/tests')
-rw-r--r-- | mediagoblin/tests/test_submission.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mediagoblin/tests/test_submission.py b/mediagoblin/tests/test_submission.py index 7c372745..4a0543a8 100644 --- a/mediagoblin/tests/test_submission.py +++ b/mediagoblin/tests/test_submission.py @@ -1,3 +1,4 @@ + # GNU MediaGoblin -- federated, autonomous media hosting # Copyright (C) 2011 MediaGoblin contributors. See AUTHORS. # @@ -16,6 +17,7 @@ import urlparse import pkg_resources +import re from nose.tools import assert_equal, assert_true, assert_false @@ -216,7 +218,8 @@ class TestSubmission: context = template.TEMPLATE_TEST_CONTEXT['mediagoblin/submit/start.html'] form = context['submit_form'] - assert form.file.errors == [u'Invalid file type.'] + assert re.match(r'^Could not extract any file extension from ".*?"$', str(form.file.errors[0])) + assert len(form.file.errors) == 1 # NOTE: The following 2 tests will ultimately fail, but they # *will* pass the initial form submission step. Instead, |