示例#1
0
 def testNoTZ(self):
     self.failUnlessEqual(
         datetimeToRFC2822Date(datetime(2013, 10, 26, 1, 0, 33)),
         "Sat, 26 Oct 2013 01:00:33")
示例#2
0
 def testWayInPast(self):
     self.failUnlessEqual(
         datetimeToRFC2822Date(datetime(1811, 1, 2, 23, 15, 37)),
         "Wed, 02 Jan 1811 23:15:37")
示例#3
0
 def testTZ(self):
     tz = ICUtzinfo.getInstance("Africa/Johannesburg")
     self.failUnlessEqual(
         datetimeToRFC2822Date(datetime(2004, 4, 13, 13, 13, 0, tzinfo=tz)),
         "Tue, 13 Apr 2004 13:13:00 +0200")
示例#4
0
 def testWayInFuture(self):
     self.failUnlessEqual(
         datetimeToRFC2822Date(datetime(2171, 11, 3, 2, 45, 3)),
         "Sun, 03 Nov 2171 02:45:03")
示例#5
0
 def testNoTZ(self):
     self.failUnlessEqual(
         datetimeToRFC2822Date(datetime(2013, 10, 26, 1, 0, 33)),
         "Sat, 26 Oct 2013 01:00:33"
     )
示例#6
0
 def testTZ(self):
     tz = ICUtzinfo.getInstance("Africa/Johannesburg")
     self.failUnlessEqual(
         datetimeToRFC2822Date(datetime(2004, 4, 13, 13, 13, 0, tzinfo=tz)),
         "Tue, 13 Apr 2004 13:13:00 +0200"
     )
示例#7
0
 def testWayInPast(self):
     self.failUnlessEqual(
         datetimeToRFC2822Date(datetime(1811, 1, 2, 23, 15, 37)),
         "Wed, 02 Jan 1811 23:15:37"
     )
示例#8
0
 def testWayInFuture(self):
     self.failUnlessEqual(
         datetimeToRFC2822Date(datetime(2171, 11, 3, 2, 45, 3)),
         "Sun, 03 Nov 2171 02:45:03"
     )