def test_basic_user(self): team = generate_sample_model_tree('Team', self.db) user = User(username="******", password="******", team=team) self.db.save(user) assert user.id is 1 assert user.username == "testuser" assert user.password == User.generate_hash('testpass') assert user.team is team assert user.team_id is team.id assert user.get_id() == 1
def test_basic_user(self): team = generate_sample_model_tree("Team", self.session) user = User(username="******", password="******", team=team) self.session.add(user) self.session.commit() assert user.id == 1 assert user.username == "testuser" assert user.password == User.generate_hash("testpass") assert user.team is team assert user.team_id is team.id assert user.get_id() == 1
def test_init_service(self): user = User(username="******", password="******") assert user.id is None assert user.username == "testuser" assert user.password == User.generate_hash("testpass") assert type(user.password) is str assert user.team is None assert user.team_id is None assert user.is_authenticated is None assert user.is_active is True assert user.is_anonymous is False assert user.get_username == "testuser" assert user.get_id() is None