def test_soundtrack_invalid_extension(self, game_created): soundtrack = SoundtrackFactory.build(soundtrack='soundtrack.mp4', game=game_created) validation_test( soundtrack, mount_error_dict(['soundtrack'], [[ErrorMessage.SOUNDTRACK_EXTENSION]]))
def test_cover_image_extension(self, name, cover_image, version, official_repository, errors_dict): game = Game(name=name, cover_image=cover_image, version=version, official_repository=official_repository) validation_test(game, errors_dict)
def test_package(self): PlatformFactory() package = PackageFactory.build(game=GameFactory()) with patch("game.validators._get_size", return_value=1 + 1024**3): validation_test( package, mount_error_dict(["package"], [[ErrorMessage.FILE_TOO_BIG]]))
def test_name_validation(self, name, year, place, errors_dict): award = Award(name=name, place=place, year=year) validation_test(award, errors_dict)
def test_description_validation(self, description, errors_dict, game): information = InformationFactory.build(description=description, game=game) validation_test(information, errors_dict)
def test_launch_year_validation(self, launch_year, errors_dict, game): information = InformationFactory.build(launch_year=launch_year, game=game) validation_test(information, errors_dict)
def test_avatar_valid_extension(self, avatar, errors_dict): developer = DeveloperFactory.build(avatar=avatar, ) validation_test(developer, errors_dict)
def test_name_validation(self, name, errors_dict): genre = GenreFactory.build(name=name) validation_test(genre, errors_dict)
def test_description_validation(self, description, errors_dict): genre = GenreFactory.build(description=description) validation_test(genre, errors_dict)
def test_video_invalid_extension(self, game_created): video = VideoFactory.build(video='video.jpg', game=game_created) validation_test( video, mount_error_dict(['video'], [[ErrorMessage.VIDEO_EXTENSION]]))
def test_icon_extension(self, name, icon, extensions, errors_dict): platform = Platform(name=name, icon=icon, extensions=extensions) validation_test(platform, errors_dict)
def test_field_validation(self, field, value, errors_dict): platform = PlatformFactory.build() setattr(platform, field, value) validation_test(platform, errors_dict)
def test_architecture_validation(self, architecture, errors_dict, platform): package = PackageFactory.build(architecture=architecture, game=GameFactory()) validation_test(package, errors_dict)
def test_name_validation(self, name, errors_dict): credit = CreditFactory.build(name=name) validation_test(credit, errors_dict)
def test_place_validation(self, place, name, errors_dict): award = Award(name=name, place=place) validation_test(award, errors_dict)