コード例 #1
0
 def test_missing_context(self):
     with self.assertRaises(Exception):
         static_webp(context={}, static_path=self.static_path, quality=75)
コード例 #2
0
 def test_no_webp_support(self):
     context = {"webp_compatible": False}
     result = static_webp(context=context,
                          static_path=self.static_path,
                          quality=75)
     assert result == static(self.webp_image.static_path)
コード例 #3
0
 def test_static_webp_templatetag(self):
     context = {"webp_compatible": True}
     result = static_webp(context=context,
                          static_path=self.static_path,
                          quality=75)
     assert result == self.webp_image.url
コード例 #4
0
 def test_static_webp_templatetag(self):
     context = {'webp_compatible': True}
     result = static_webp(context=context, static_path=self.static_path)
     assert result == self.webp_image.url
コード例 #5
0
 def test_no_webp_support(self):
     context = {'webp_compatible': False}
     result = static_webp(context=context, static_path=self.static_path)
     assert result == static(self.webp_image.static_path)
コード例 #6
0
 def test_missing_context(self):
     with self.assertRaises(Exception):
         static_webp(context={}, static_path=self.static_path)
コード例 #7
0
 def test_static_webp_templatetag(self):
     context = {'webp_compatible': True}
     result = static_webp(context=context, static_path=self.static_path)
     assert result == self.webp_image.url