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.
This commit is contained in:
Joar Wandborg
2011-11-30 21:21:39 +01:00
committed by Christopher Allan Webber
parent 992e4f8032
commit a246ccca69
18 changed files with 7323 additions and 11 deletions

View File

@@ -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,