Esempio n. 1
0
def test_Date_as_date():
    dd = Date()
    assert isinstance(dd.as_date(), datetime.date)
    assert not isinstance(dd.as_date(), Date)
Esempio n. 2
0
def test_Date_default():
    today = datetime.date.today()
    dd = Date()
    dd.to_string()
    for key in 'year', 'month', 'day':
        assert getattr(dd, key) == getattr(today, key)
Esempio n. 3
0
def test_Date_fromordinal(dd):
    dd2 = Date.fromordinal(dd.toordinal())
    assert dd2 == dd
Esempio n. 4
0
def test_DateTime_date():
    dt = DateTime()
    assert isinstance(dt.date(), Date)
    assert dt.date() == Date.today()