Kaydet (Commit) b6fbf3e8 authored tarafından Pavlo Kapyshin's avatar Pavlo Kapyshin Kaydeden (comit) Tim Graham

Fixed #27879 -- Fixed crash if enclosures aren't provided to Atom1Feed.add_item().

Regression in 75cf9b5a
üst 508b5deb
...@@ -612,6 +612,7 @@ answer newbie questions, and generally made Django that much better: ...@@ -612,6 +612,7 @@ answer newbie questions, and generally made Django that much better:
Paulo Scardine <paulo@scardine.com.br> Paulo Scardine <paulo@scardine.com.br>
Paul Smith <blinkylights23@gmail.com> Paul Smith <blinkylights23@gmail.com>
pavithran s <pavithran.s@gmail.com> pavithran s <pavithran.s@gmail.com>
Pavlo Kapyshin <i@93z.org>
permonik@mesias.brnonet.cz permonik@mesias.brnonet.cz
Petar Marić <http://www.petarmaric.com/> Petar Marić <http://www.petarmaric.com/>
Pete Crosier <pete.crosier@gmail.com> Pete Crosier <pete.crosier@gmail.com>
......
...@@ -137,7 +137,7 @@ class SyndicationFeed: ...@@ -137,7 +137,7 @@ class SyndicationFeed:
'comments': to_str(comments), 'comments': to_str(comments),
'unique_id': to_str(unique_id), 'unique_id': to_str(unique_id),
'unique_id_is_permalink': unique_id_is_permalink, 'unique_id_is_permalink': unique_id_is_permalink,
'enclosures': enclosures, 'enclosures': enclosures or (),
'categories': categories or (), 'categories': categories or (),
'item_copyright': to_str(item_copyright), 'item_copyright': to_str(item_copyright),
'ttl': ttl, 'ttl': ttl,
......
...@@ -120,6 +120,12 @@ class FeedgeneratorTest(unittest.TestCase): ...@@ -120,6 +120,12 @@ class FeedgeneratorTest(unittest.TestCase):
self.assertIn('href="/feed/"', feed_content) self.assertIn('href="/feed/"', feed_content)
self.assertIn('rel="self"', feed_content) self.assertIn('rel="self"', feed_content)
def test_atom_add_item(self):
# Not providing any optional arguments to Atom1Feed.add_item()
feed = feedgenerator.Atom1Feed('title', '/link/', 'descr')
feed.add_item('item_title', 'item_link', 'item_description')
feed.writeString('utf-8')
class FeedgeneratorDBTest(TestCase): class FeedgeneratorDBTest(TestCase):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment