def test_users_are_not_extractors(self): department = DepartmentFactory() department.save() user = User(username='******', email='*****@*****.**') user.departments.append(department) user.save() assert Extractor.get_by_id(user.id) == None assert Extractor.query.filter_by(username=user.username).first() == None
def test_users_are_not_extractors(self): department = DepartmentFactory() department.save() user = User(username='******', email='*****@*****.**') user.departments.append(department) user.save() assert Extractor.get_by_id(user.id) == None assert Extractor.query.filter_by( username=user.username).first() == None
def test_password_is_nullable(self): user = User(username='******', email='*****@*****.**') user.save() assert user.password is None
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)
def test_get_by_id(self): user = User('foo', '*****@*****.**') user.save() retrieved = User.get_by_id(user.id) assert retrieved == user