def test_get_enclosure_uses_formated_photo_when_format_available(self): f = Format.objects.create(name='enc_format', max_width=10, max_height=10, flexible_height=False, stretch=False, nocrop=False) feeder = RSSTopCategoryListings() feeder.format = f self._set_photo() tools.assert_true(self.publishables[0].photo is not None) original = self.publishables[0].photo.image new = self._feeder.item_enclosure_url(self.listings[0]) tools.assert_not_equals(unicode(original), unicode(new))
def test_no_enclosure_when_format_not_set(self): feeder = RSSTopCategoryListings() feeder.format = None self._set_photo() tools.assert_true(self.publishables[0].photo is not None) tools.assert_equals(None, feeder.item_enclosure_url(self.listings[0]))