From 8683b0680ddd9dfc05bf1c1bf01356b2b96b36b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonel=20C=C3=A2mara?= Date: Sat, 19 Mar 2016 14:55:16 +0000 Subject: [PATCH] add test for something that is NOT an image --- gluon/tests/test_validators.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gluon/tests/test_validators.py b/gluon/tests/test_validators.py index ba21c1db..8bcbacdd 100644 --- a/gluon/tests/test_validators.py +++ b/gluon/tests/test_validators.py @@ -804,6 +804,11 @@ class TestValidators(unittest.TestCase): rtn = IS_IMAGE(error_message='oops', minsize=(100, 50))(img) self.assertEqual(rtn, (img, 'oops')) + img = DummyImageFile('test', 'xls', 50, 100) + rtn = IS_IMAGE(error_message='oops')(img) + self.assertEqual(rtn, (img, 'oops')) + + def test_IS_UPLOAD_FILENAME(self): import cgi from StringIO import StringIO