Author: aaugustin
Date: 2011-10-15 03:16:24 -0700 (Sat, 15 Oct 2011)
New Revision: 16989

Modified:
   django/trunk/tests/regressiontests/utils/feedgenerator.py
Log:
Ensured that the feeds framework supports both datetimes and dates. Refs #4076.


Modified: django/trunk/tests/regressiontests/utils/feedgenerator.py
===================================================================
--- django/trunk/tests/regressiontests/utils/feedgenerator.py   2011-10-15 
09:00:31 UTC (rev 16988)
+++ django/trunk/tests/regressiontests/utils/feedgenerator.py   2011-10-15 
10:16:24 UTC (rev 16989)
@@ -42,6 +42,15 @@
             "Fri, 14 Nov 2008 13:37:00 +0100"
         )
 
+    def test_rfc2822_date_without_time(self):
+        """
+        Test rfc2822_date() correctly formats date objects.
+        """
+        self.assertEqual(
+            feedgenerator.rfc2822_date(datetime.date(2008, 11, 14)),
+            "Fri, 14 Nov 2008 00:00:00 -0000"
+        )
+
     def test_rfc3339_date(self):
         """
         Test rfc3339_date() correctly formats datetime objects.
@@ -60,6 +69,15 @@
             "2008-11-14T13:37:00+02:00"
         )
 
+    def test_rfc3339_date_without_time(self):
+        """
+        Test rfc3339_date() correctly formats date objects.
+        """
+        self.assertEqual(
+            feedgenerator.rfc3339_date(datetime.date(2008, 11, 14)),
+            "2008-11-14T00:00:00Z"
+        )
+
     def test_atom1_mime_type(self):
         """
         Test to make sure Atom MIME type has UTF8 Charset parameter set

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to