More Unicode titles to prevent non-Unicode SQLAlchemy warnings.
authorBrett Smith <brettcsmith@brettcsmith.org>
Sun, 8 Jul 2012 14:18:33 +0000 (10:18 -0400)
committerBrett Smith <brettcsmith@brettcsmith.org>
Sun, 8 Jul 2012 14:18:33 +0000 (10:18 -0400)
mediagoblin/tests/test_submission.py

index 3cc5280c0ce13976b49d37625fc73725c1b6afb5..b7b0e5748f849ad7f4cdea26ad841bf9893f2661 100644 (file)
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+import sys
+reload(sys)
+sys.setdefaultencoding('utf-8')
+
 import urlparse
 import os
 
@@ -229,12 +233,12 @@ class TestSubmission:
     def test_evil_jpg(self):
         # Test non-supported file with .jpg extension
         # -------------------------------------------
-        self.check_false_image('Malicious Upload 2', EVIL_JPG)
+        self.check_false_image(u'Malicious Upload 2', EVIL_JPG)
 
     def test_evil_png(self):
         # Test non-supported file with .png extension
         # -------------------------------------------
-        self.check_false_image('Malicious Upload 3', EVIL_PNG)
+        self.check_false_image(u'Malicious Upload 3', EVIL_PNG)
 
     def test_processing(self):
         data = {'title': u'Big Blue'}