示例#1
0
def test_user_created_at_defaults_to_datetime():
    user = User(email='*****@*****.**')
    user.save()
    assert bool(user.created_at)
    assert isinstance(user.created_at, dt.datetime)

    user.delete()
def test_user_created_at_defaults_to_datetime():
    user = User(email='*****@*****.**')
    user.save()
    assert bool(user.created_at)
    assert isinstance(user.created_at, dt.datetime)

    user.delete()
示例#3
0
def test_user_get_by_id():
    user = User('foo', '*****@*****.**')
    user.save()

    retrieved = User.get_by_id(user.id)
    assert retrieved == user

    user.delete()
def test_user_get_by_id():
    user = User('foo', '*****@*****.**')
    user.save()

    retrieved = User.get_by_id(user.id)
    assert retrieved == user

    user.delete()
示例#5
0
def test_user_password_is_nullable():
    user = User(email='*****@*****.**')
    user.save()
    assert user.password is None

    user.delete()
def test_user_password_is_nullable():
    user = User(email='*****@*****.**')
    user.save()
    assert user.password is None

    user.delete()