Chris Beaven avatar Chris Beaven committed e572134

Fix templatetags tests

Comments (0)

Files changed (1)

sorl/thumbnail/tests/templatetags.py

         self.assertEqual(self.render_template(src_missing), '')
         # ...and with THUMBNAIL_DEBUG = True
         self.change_settings.change({'DEBUG': True})
-        self.assertRaises(TypeError, self.render_template, src_invalid)
-        self.assertRaises(TypeError, self.render_template, src_missing)
+        self.assertRaises(TemplateSyntaxError, self.render_template,
+                          src_invalid)
+        self.assertRaises(TemplateSyntaxError, self.render_template,
+                          src_missing)
 
         # Invalid source
         src = '{% thumbnail invalid_source 80x80 %}'
         self.assertEqual(self.render_template(src), '')
         # ...and with THUMBNAIL_DEBUG = True
         self.change_settings.change({'DEBUG': True})
-        self.assertRaises(ThumbnailException, self.render_template, src)
-        self.assertRaises(ThumbnailException, self.render_template,
+        self.assertRaises(TemplateSyntaxError, self.render_template, src)
+        self.assertRaises(TemplateSyntaxError, self.render_template,
                           src_on_context)
 
         # Non-existant source
         self.assertEqual(self.render_template(src), '')
         # ...and with THUMBNAIL_DEBUG = True
         self.change_settings.change({'DEBUG': True})
-        self.assertRaises(ThumbnailException, self.render_template, src)
+        self.assertRaises(TemplateSyntaxError, self.render_template, src)
 
         # Invalid size as a tuple:
         src = '{% thumbnail source invalid_size %}'
         self.assertEqual(self.render_template(src), '')
         # ...and THUMBNAIL_DEBUG = True
         self.change_settings.change({'DEBUG': True})
-        self.assertRaises(TypeError, self.render_template, src)
+        self.assertRaises(TemplateSyntaxError, self.render_template, src)
         # Invalid size as a string:
         src = '{% thumbnail source invalid_strsize %}'
         # ...with THUMBNAIL_DEBUG = False
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.