Permalink
Browse files

Ensured that the feeds framework supports both datetimes and dates. R…

…efs #4076.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16989 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent a8e1d13 commit 22d738c2dc87c073c20051c9fd19fa2c2887dbaa @aaugustin aaugustin committed Oct 15, 2011
Showing with 18 additions and 0 deletions.
  1. +18 −0 tests/regressiontests/utils/feedgenerator.py
@@ -42,6 +42,15 @@ def test_rfc2822_date_with_timezone(self):
"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 @@ def test_rfc3339_date_with_timezone(self):
"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

0 comments on commit 22d738c

Please sign in to comment.