Esempio n. 1
0
 def test_created_at_defaults_to_datetime(self):
     user = User(email='*****@*****.**')
     user.save()
     assert bool(user.date_created)
     assert isinstance(user.date_created, dt.datetime)
Esempio n. 2
0
 def test_password_is_nullable(self):
     user = User(email='*****@*****.**')
     user.save()
     assert user.password is None
Esempio n. 3
0
    def test_get_by_id(self):
        user = User('foo', '*****@*****.**')
        user.save()

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