示例#1
0
文件: test_models.py 项目: j127/fca
 def test_created_at_defaults_to_datetime(self):
     user = User(username='******', email='*****@*****.**')
     user.save()
     assert bool(user.created_at)
     assert isinstance(user.created_at, dt.datetime)
示例#2
0
文件: test_models.py 项目: j127/fca
 def test_password_is_nullable(self):
     user = User(username='******', email='*****@*****.**')
     user.save()
     assert user.password is None
示例#3
0
文件: test_models.py 项目: j127/fca
    def test_get_by_id(self):
        user = User('foo', '*****@*****.**')
        user.save()

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