summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamiro Morales <ramiro@rmorales.net>2013-10-02 19:34:38 -0300
committerRamiro Morales <ramiro@rmorales.net>2013-10-03 22:50:51 -0300
commit5252885494079cf28a337644a87e61b19340f09c (patch)
tree13110f38f76bc67d6105f66d7df492fc75f26e93
parente2e7571035173ed153b38e91a3945a074ceada57 (diff)
[1.6.x] Fixed #21165 -- Fix test for syndication feed timestamp field on Windows.
Thanks Michael Manfre for the report, Raphaƫl Barrois for the patch and Claude Paroz, Aymeric Augustin for the reviews. Refs #7936 62dfd79f8b from master.
-rw-r--r--tests/syndication/tests.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/syndication/tests.py b/tests/syndication/tests.py
index 1627f7182b..21bb8298c3 100644
--- a/tests/syndication/tests.py
+++ b/tests/syndication/tests.py
@@ -5,6 +5,7 @@ from xml.dom import minidom
from django.contrib.syndication import views
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
+from django.test.utils import requires_tz_support
from django.utils import tzinfo
from django.utils.feedgenerator import rfc2822_date, rfc3339_date
@@ -260,10 +261,21 @@ class SyndicationFeedTest(FeedTestCase):
updated = doc.getElementsByTagName('updated')[0].firstChild.wholeText
self.assertEqual(updated[-6:], '+00:42')
- def test_feed_last_modified_time(self):
+ @requires_tz_support
+ def test_feed_last_modified_time_naive_date(self):
+ """
+ Tests the Last-Modified header with naive publication dates.
+ """
response = self.client.get('/syndication/naive-dates/')
self.assertEqual(response['Last-Modified'], 'Thu, 03 Jan 2008 19:30:00 GMT')
+ def test_feed_last_modified_time(self):
+ """
+ Tests the Last-Modified header with aware publication dates.
+ """
+ response = self.client.get('/syndication/aware-dates/')
+ self.assertEqual(response['Last-Modified'], 'Thu, 03 Jan 2008 12:48:00 GMT')
+
# No last-modified when feed has no item_pubdate
response = self.client.get('/syndication/no_pubdate/')
self.assertFalse(response.has_header('Last-Modified'))