Example #1
0
def test_birthdate_custom_strftime():
    a = birthdate(custom_strftime="%m/%d/%Y")
    a_split = str(a).split("/")
    assert len(a_split) == 3
    assert int(a_split[0]) <= 12
    assert int(a_split[1]) <= 31
    assert int(a_split[2]) <= 2015
Example #2
0
def test_birthdate_is_attrdict():
    a = birthdate()
    assert isinstance(a, AttrDict)
Example #3
0
def test_birthdate_custom_strftime_dto():
    a = birthdate(custom_strftime="DTO")
    assert type(a) == type(datetime.now())
Example #4
0
def test_birthdate_year():
    a = birthdate()
    assert 1900 <= int(a.year) <= 2015
Example #5
0
def test_birthdate_day():
    a = birthdate()
    assert 1 <= int(a.day) <= 31
    isinstance(a, StringType)
Example #6
0
def test_birthdate_month():
    a = birthdate()
    assert 1 <= int(a.month) <= 12
    isinstance(a, StringType)
Example #7
0
def test_birthdate_max_year():
    a = birthdate(min_year=3000, max_year=3000)
    assert a.year == "3000"
    isinstance(a.year, StringType)
Example #8
0
def test_birthdate_min_year():
    a = birthdate(min_year=2015)
    assert a.year == "2015"
    isinstance(a.year, StringType)