def add_team_member( request_data: RequestModel, teams: Repository = Inject(qualifier=Team), racers: Repository = Inject(qualifier=Racer), ): team: Team = teams.find(request_data['team_id']) racer: Racer = racers.find(request_data['racer_id']) team.members.append(racer) teams.update(team) return ResponseModel(data=request_data, errors={})
def add_team_member( request_data: RequestModel, teams: Repository = Inject(qualifier=Team), racers: Repository = Inject(qualifier=Racer), ): team: Team = teams.find(request_data['team_id']) racer: Racer = racers.find(request_data['racer_id']) team.members.append(racer) teams.update(team) return ResponseModel(data=request_data, errors={})
def test_update_success(self, data, repo: Repository, dao: IDao): id_ = dao.insert(**data) entity = repo.find(id_) entity.frame_type = 'road' repo.update(entity) assert dao.get(id_) == {'frame_type': 'road', 'wheel_type': 'road'}
def test_update_success(self, data, repo: Repository, dao: IDao): id_ = dao.insert(**data) entity = repo.find(id_) entity.frame_type = 'road' repo.update(entity) assert dao.get(id_) == {'frame_type': 'road', 'wheel_type': 'road'}
def test_update_success(self, data, repo: Repository, dao: IDao): id_ = dao.insert(**data) entity = repo.find(id_) entity.frame_type = "road" repo.update(entity) assert dao.get(id_) == {"frame_type": "road", "wheel_type": "road"}