コード例 #1
0
 def test_scummvm_script_requires_game_id(self):
     script = json.dumps({'game': {}})
     installer = Installer(runner=Runner(name="ScummVM", slug='scummvm'),
                           content=script)
     is_valid, errors = validate_installer(installer)
     self.assertFalse(is_valid, errors)
     self.assertIn(
         "ScummVM game should have a "
         "game identifier in the 'game' section", errors)
コード例 #2
0
ファイル: pages.py プロジェクト: djibux/website
def new_installer(request, slug):
    game = get_object_or_404(models.Game, slug=slug)
    installer = Installer(game=game)
    installer.set_default_installer()
    form = InstallerForm(request.POST or None, instance=installer)
    if request.method == "POST" and form.is_valid():
        installer = form.save(commit=False)
        installer.game_id = game.id
        installer.user = request.user
        installer.save()
        notify_installer(installer)
        return redirect("installer_complete", slug=game.slug)
    return render(
        request, "installers/form.html", {"form": form, "game": game, "new": True}
    )
コード例 #3
0
ファイル: pages.py プロジェクト: retiform/website
def new_installer(request, slug):
    game = get_object_or_404(models.Game, slug=slug)
    installer = Installer(game=game)
    installer.set_default_installer()
    form = InstallerForm(request.POST or None, instance=installer)
    if request.method == 'POST' and form.is_valid():
        installer = form.save(commit=False)
        installer.game_id = game.id
        installer.user = request.user
        installer.save()
        return redirect("installer_complete", slug=game.slug)
    return render(request, 'installers/form.html', {
        'form': form,
        'game': game,
        'new': True
    })
コード例 #4
0
ファイル: pages.py プロジェクト: Freso/website
def new_installer(request, slug):
    game = get_object_or_404(models.Game, slug=slug)
    installer = Installer(game=game)
    installer.set_default_installer()
    form = InstallerForm(request.POST or None, instance=installer)
    if request.method == 'POST' and form.is_valid():
        installer = form.save(commit=False)
        installer.game_id = game.id
        installer.user = request.user
        installer.save()
        return redirect("installer_complete", slug=game.slug)
    return render(request, 'games/installer-form.html',
                  {'form': form, 'game': game, 'new': True})
コード例 #5
0
ファイル: pages.py プロジェクト: lutris/website
def new_installer(request, slug):
    game = get_object_or_404(models.Game, slug=slug)
    installer = Installer(game=game)
    installer.set_default_installer()
    form = InstallerForm(request.POST or None, instance=installer)
    if request.method == "POST" and form.is_valid():
        installer = form.save(commit=False)
        installer.game_id = game.id
        installer.user = request.user
        installer.save()
        notify_installer(installer)
        return redirect("installer_complete", slug=game.slug)
    return render(
        request, "installers/form.html", {"form": form, "game": game, "new": True}
    )
コード例 #6
0
 def setUp(self):
     self.installer = Installer(
         runner=Runner(name="Linux"),
         version="test",
     )