Author: jacob
Date: 2008-08-27 14:52:27 -0500 (Wed, 27 Aug 2008)
New Revision: 8632
Modified:
django/trunk/tests/regressiontests/syndication/fixtures/feeddata.json
django/trunk/tests/regressiontests/syndication/tests.py
Log:
Added a test to ensure that strings in RSS are properly escaped. Refs #6533.
Modified: django/trunk/tests/regressiontests/syndication/fixtures/feeddata.json
===================================================================
--- django/trunk/tests/regressiontests/syndication/fixtures/feeddata.json
2008-08-27 16:44:52 UTC (rev 8631)
+++ django/trunk/tests/regressiontests/syndication/fixtures/feeddata.json
2008-08-27 19:52:27 UTC (rev 8632)
@@ -22,5 +22,13 @@
"title": "My third entry",
"date": "2008-01-02 13:30:00"
}
+ },
+ {
+ "model": "syndication.entry",
+ "pk": 4,
+ "fields": {
+ "title": "A & B < C > D",
+ "date": "2008-01-03 13:30:00"
+ }
}
]
\ No newline at end of file
Modified: django/trunk/tests/regressiontests/syndication/tests.py
===================================================================
--- django/trunk/tests/regressiontests/syndication/tests.py 2008-08-27
16:44:52 UTC (rev 8631)
+++ django/trunk/tests/regressiontests/syndication/tests.py 2008-08-27
19:52:27 UTC (rev 8632)
@@ -81,4 +81,14 @@
response = self.client.get('/syndication/feeds/complex/')
self.assertEquals(response.status_code, 404)
-
+ def test_title_escaping(self):
+ """
+ Tests that titles are escaped correctly in RSS feeds.
+ """
+ response = self.client.get('/syndication/feeds/rss/')
+ doc = minidom.parseString(response.content)
+ for item in doc.getElementsByTagName('item'):
+ link = item.getElementsByTagName('link')[0]
+ if link.firstChild.wholeText == 'http://example.com/blog/4/':
+ title = item.getElementsByTagName('title')[0]
+ self.assertEquals(title.firstChild.wholeText, u'A & B <
C > D')
\ No newline at end of file
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---