def test_remove_team_duplicate_url_error(self, remove): remove.side_effect = Video.DuplicateUrlError( self.video.get_primary_videourl_obj()) team = TeamFactory(slug='test-team') TeamVideoFactory(video=self.video, team=team) with assert_raises(ValidationError): self.run_update({'team': None})
def test_move_to_team_duplicate_url_error(self, move_to): move_to.side_effect = Video.DuplicateUrlError( self.video.get_primary_videourl_obj()) team1 = TeamFactory(slug='team1') team2 = TeamFactory(slug='team2') TeamVideoFactory(video=self.video, team=team1) with assert_raises(ValidationError): self.run_update({'team': 'team2'})
def test_add_to_team_duplicate_url_error(self, add_existing_video): add_existing_video.side_effect = Video.DuplicateUrlError( self.video.get_primary_videourl_obj()) team = TeamFactory(slug='test-team') with assert_raises(ValidationError): self.run_update({ 'team': 'test-team', })