示例#1
0
 def test_valueerror_when_incomplete_date(self):
     with self.assertRaises(ValueError):
         date(2013, 1)
示例#2
0
 def test_date_specified_with_just_minutes(self):
     func = date(2013, 1, 2, minute=40)
     d = func()
     self.assert_timestamp_equal(1357087200, d)
示例#3
0
 def test_date_specified_with_tz_offset(self):
     func = date(2013, 1, 2, 3, 4, 5, 6, tz='Asia/Kuwait')
     d = func()
     self.assert_timestamp_equal(1357085045, d)
示例#4
0
 def test_date_now(self):
     func = date()
     d = func()
     self.assert_timestamp_equal(1326511294, d)
示例#5
0
 def test_date_specified(self):
     func = date(2013, 1, 2, 3, 4, 5, 6)
     d = func()
     self.assert_timestamp_equal(1357095845, d)
示例#6
0
 def test_valueerror_when_incomplete_date(self):
     with self.assertRaises(ValueError):
         date(2013, 1)
示例#7
0
 def test_date_specified_with_tz_offset(self):
     func = date(2013, 1, 2, 3, 4, 5, 6, tz='Asia/Kuwait')
     d = func()
     self.assert_timestamp_equal(1357085045, d)
示例#8
0
 def test_date_specified_with_just_minutes(self):
     func = date(2013, 1, 2, minute=40)
     d = func()
     self.assert_timestamp_equal(1357087200, d)
示例#9
0
 def test_date_specified(self):
     func = date(2013, 1, 2, 3, 4, 5, 6)
     d = func()
     self.assert_timestamp_equal(1357095845, d)
示例#10
0
 def test_date_now(self):
     func = date()
     d = func()
     self.assert_timestamp_equal(1326511294, d)