def test_missing_context(self): with self.assertRaises(Exception): static_webp(context={}, static_path=self.static_path, quality=75)
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)
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
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
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)
def test_missing_context(self): with self.assertRaises(Exception): static_webp(context={}, static_path=self.static_path)