Code

Ticket #15237: django_15237.diff

File django_15237.diff, 1.1 KB (added by jasonkotenko, 3 years ago)

SVN diff

Line 
1Index: django/utils/feedgenerator.py
2===================================================================
3--- django/utils/feedgenerator.py       (revision 15481)
4+++ django/utils/feedgenerator.py       (working copy)
5@@ -287,7 +287,7 @@
6 
7 class Atom1Feed(SyndicationFeed):
8     # Spec: http://atompub.org/2005/07/11/draft-ietf-atompub-format-10.html
9-    mime_type = 'application/atom+xml'
10+    mime_type = 'application/atom+xml; charset=utf8'
11     ns = u"http://www.w3.org/2005/Atom"
12 
13     def write(self, outfile, encoding):
14Index: tests/regressiontests/utils/feedgenerator.py
15===================================================================
16--- tests/regressiontests/utils/feedgenerator.py        (revision 15481)
17+++ tests/regressiontests/utils/feedgenerator.py        (working copy)
18@@ -60,3 +60,12 @@
19             "2008-11-14T13:37:00+02:00"
20         )
21 
22+    def test_atom1_mime_type(self):
23+        """
24+        Test to make sure Atom MIME type has UTF8 Charset parameter set
25+        """
26+        atom_feed = feedgenerator.Atom1Feed("title", "link", "description")
27+        self.assertEqual(
28+            atom_feed.mime_type, "application/atom+xml; charset=utf8"
29+        )
30+