Ejemplo n.º 1
0
def test_daterange():
    fmt = '%Y-%m-%d'
    start_date = datetime.datetime.strptime('2012-01-01', fmt)
    end_date = datetime.datetime.strptime('2012-01-05', fmt)

    assert list(utils.daterange(start_date, end_date, fmt)) == [
        '2012-01-01', '2012-01-02', '2012-01-03', '2012-01-04'
    ]
Ejemplo n.º 2
0
    def test_daterange(self):
        format = '%Y-%m-%d'
        start_date = datetime.datetime.strptime('2012-01-01', format)
        end_date = datetime.datetime.strptime('2012-01-05', format)

        expected = ['2012-01-01', '2012-01-02', '2012-01-03', '2012-01-04']

        for i, d in enumerate(utils.daterange(start_date, end_date, format)):
            eq_(d, expected[i])
Ejemplo n.º 3
0
    def test_daterange(self):
        format = '%Y-%m-%d'
        start_date = datetime.datetime.strptime('2012-01-01', format)
        end_date = datetime.datetime.strptime('2012-01-05', format)

        expected = [
            '2012-01-01',
            '2012-01-02',
            '2012-01-03',
            '2012-01-04'
        ]

        for i, d in enumerate(utils.daterange(start_date, end_date, format)):
            eq_(d, expected[i])