Ejemplo n.º 1
0
    def test_fill_date_with_invalid_data(self):
        then = datetime.date(2013, 12, 10)
        now = datetime.date(2013, 12, 8)

        result = models.fill_date(then, now=now)

        self.assertEqual(0, len(result))
Ejemplo n.º 2
0
    def test_fill_date_with_one_date(self):
        then = datetime.date(2013, 12, 10)

        result = models.fill_date(then, now=then)

        self.assertEqual(1, len(result))
        self.assertEqual(result[0], then)
        self.assertEqual(result[-1], then)
Ejemplo n.º 3
0
    def test_fill_date_with_data(self):
        then = datetime.date(2013, 12, 10)
        now = datetime.date(2013, 12, 21)

        result = models.fill_date(then, now=now)

        self.assertEqual(12, len(result))
        self.assertEqual(result[0], then)
        self.assertEqual(result[-1], now)