commit
b4c815b801
3 changed files with 10 additions and 4 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -153,3 +153,4 @@ tags
|
||||||
# IDE
|
# IDE
|
||||||
.idea/
|
.idea/
|
||||||
.c9/
|
.c9/
|
||||||
|
.vscode/
|
|
@ -100,7 +100,7 @@ class GenRSS:
|
||||||
channel_image = self.image
|
channel_image = self.image
|
||||||
if not channel_image and self.image_url:
|
if not channel_image and self.image_url:
|
||||||
channel_image = Image(self.image_url, self.site_url, self.title)
|
channel_image = Image(self.image_url, self.site_url, self.title)
|
||||||
if isinstance(image, Image):
|
if isinstance(channel_image, Image):
|
||||||
channel.append(channel_image.to_element())
|
channel.append(channel_image.to_element())
|
||||||
|
|
||||||
for category in self.categories:
|
for category in self.categories:
|
||||||
|
|
|
@ -80,10 +80,15 @@ def test_feed_image_url():
|
||||||
image_url = 'https://s3.smartfridge.me/image.jpg'
|
image_url = 'https://s3.smartfridge.me/image.jpg'
|
||||||
feed = create_rss(image_url=image_url)
|
feed = create_rss(image_url=image_url)
|
||||||
xml = feed.xml()
|
xml = feed.xml()
|
||||||
|
|
||||||
assert xml
|
assert xml
|
||||||
assert (f'<image><url>{image_url}</url>'
|
assert (
|
||||||
|
'<image>'
|
||||||
|
f'<url>{image_url}</url>'
|
||||||
|
'<link>https://smartfridge.me/</link>'
|
||||||
'<title><![CDATA[SmartFridge]]></title>'
|
'<title><![CDATA[SmartFridge]]></title>'
|
||||||
'<link>https://smartfridge.me/</link></image>') in xml
|
'</image>'
|
||||||
|
) in xml
|
||||||
|
|
||||||
|
|
||||||
def test_feed_webmaster():
|
def test_feed_webmaster():
|
||||||
|
|
Loading…
Reference in a new issue