From 43b3b5ccfe6343ba77598a3aa7e694050bd07234 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 12 May 2020 15:09:06 +0200 Subject: [PATCH] Fix CI --- .gitlab-ci.yml | 7 ++++++- media/forms.py | 2 +- media/tests/test_templates.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d1acd36..449eecf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: python:3.6 +image: python:3.8 stages: - test @@ -21,6 +21,11 @@ python37: stage: test script: tox -e py37 +python38: + image: python:3.8 + stage: test + script: tox -e py37 + linters: stage: test script: tox -e linters diff --git a/media/forms.py b/media/forms.py index fd02718..8f767cf 100644 --- a/media/forms.py +++ b/media/forms.py @@ -198,7 +198,7 @@ class MediaAdminForm(ModelForm): from django.core.exceptions import ValidationError try: # We don't want to check a field when we enter an ISBN. - if "isbn" not in self.request.POST \ + if "_isbn" not in self.request.POST \ or not self.cleaned_data.get('isbn'): value = field.clean(value) self.cleaned_data[name] = value diff --git a/media/tests/test_templates.py b/media/tests/test_templates.py index b9d2e75..0a1a150 100644 --- a/media/tests/test_templates.py +++ b/media/tests/test_templates.py @@ -47,7 +47,7 @@ class TemplateTests(TestCase): def test_media_isbn_download(self): data = { - '_continue': True, + '_isbn': True, 'isbn': "0316358525", } response = self.client.post(reverse(