Esempio n. 1
0
  def test_compare_datetimes_tz(self):
    t1 = datetime(2017, 2, 2, 12, 0, 0)
    t2 = datetime(2017, 2, 2, 12, 0, 0, tzinfo=pytz.timezone('US/Eastern'))

    self.assertEquals(_utils.compare_datetimes(t1, t2), -1)

    t1 = t1.replace(tzinfo=pytz.timezone('US/Pacific'))

    self.assertEquals(_utils.compare_datetimes(t1, t2), 1)
Esempio n. 2
0
    def test_compare_datetimes_tz(self):
        t1 = datetime(2017, 2, 2, 12, 0, 0)
        t2 = datetime(2017, 2, 2, 12, 0, 0, tzinfo=pytz.timezone('US/Eastern'))

        self.assertEquals(_utils.compare_datetimes(t1, t2), -1)

        t1 = t1.replace(tzinfo=pytz.timezone('US/Pacific'))

        self.assertEquals(_utils.compare_datetimes(t1, t2), 1)
Esempio n. 3
0
  def test_compare_datetimes(self):
    t1, t2 = datetime(2017, 2, 2, 12, 0, 0), datetime(2017, 2, 2, 12, 0, 0)
    self.assertEquals(_utils.compare_datetimes(t1, t2), 0)

    t2 = t2.replace(hour=11)
    self.assertEquals(_utils.compare_datetimes(t1, t2), 1)
Esempio n. 4
0
    def test_compare_datetimes(self):
        t1, t2 = datetime(2017, 2, 2, 12, 0, 0), datetime(2017, 2, 2, 12, 0, 0)
        self.assertEquals(_utils.compare_datetimes(t1, t2), 0)

        t2 = t2.replace(hour=11)
        self.assertEquals(_utils.compare_datetimes(t1, t2), 1)