diff --git a/AUTHORS b/AUTHORS index e67a9014d1..7932c6c5b6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -612,6 +612,7 @@ answer newbie questions, and generally made Django that much better: Paulo Scardine Paul Smith pavithran s + Pavlo Kapyshin permonik@mesias.brnonet.cz Petar Marić Pete Crosier diff --git a/django/utils/feedgenerator.py b/django/utils/feedgenerator.py index 9dec126941..fa5c1f03ba 100644 --- a/django/utils/feedgenerator.py +++ b/django/utils/feedgenerator.py @@ -137,7 +137,7 @@ class SyndicationFeed: 'comments': to_str(comments), 'unique_id': to_str(unique_id), 'unique_id_is_permalink': unique_id_is_permalink, - 'enclosures': enclosures, + 'enclosures': enclosures or (), 'categories': categories or (), 'item_copyright': to_str(item_copyright), 'ttl': ttl, diff --git a/tests/utils_tests/test_feedgenerator.py b/tests/utils_tests/test_feedgenerator.py index 8c0edb4374..78e4d5b737 100644 --- a/tests/utils_tests/test_feedgenerator.py +++ b/tests/utils_tests/test_feedgenerator.py @@ -120,6 +120,12 @@ class FeedgeneratorTest(unittest.TestCase): self.assertIn('href="/feed/"', 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):