misc: drop support for django < 1.11 (#36087)

This commit is contained in:
Frédéric Péters 2019-09-12 20:04:56 +02:00
parent 0155649121
commit 469fceabaf
3 changed files with 5 additions and 9 deletions

2
debian/control vendored
View File

@ -16,7 +16,7 @@ Package: python-passerelle
Architecture: all Architecture: all
Depends: ${python:Depends}, Depends: ${python:Depends},
${misc:Depends}, ${misc:Depends},
python-django (>= 1.8), python-django (>= 1:1.11),
python-gadjo, python-gadjo,
python-django-model-utils, python-django-model-utils,
python-requests, python-requests,

View File

@ -9,7 +9,6 @@ import sys
import traceback import traceback
import base64 import base64
import django
from django.apps import apps from django.apps import apps
from django.conf import settings from django.conf import settings
from django.core.exceptions import ValidationError, ObjectDoesNotExist, PermissionDenied from django.core.exceptions import ValidationError, ObjectDoesNotExist, PermissionDenied
@ -446,7 +445,7 @@ class BaseResource(models.Model):
# "jobs" cron job to run asynchronous tasks # "jobs" cron job to run asynchronous tasks
resource_type = ContentType.objects.get_for_model(self) resource_type = ContentType.objects.get_for_model(self)
skip_locked = {'skip_locked': True} skip_locked = {'skip_locked': True}
if django.VERSION < (1, 11, 0) or not connection.features.has_select_for_update_skip_locked: if not connection.features.has_select_for_update_skip_locked:
skip_locked = {} skip_locked = {}
skipped_jobs = [] skipped_jobs = []
while True: while True:

View File

@ -1,6 +1,6 @@
[tox] [tox]
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/passerelle/{env:BRANCH_NAME:} toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/passerelle/{env:BRANCH_NAME:}
envlist = django{18,111}-{sqlite,pg} envlist = django111-{sqlite,pg}
[testenv] [testenv]
usedevelop = True usedevelop = True
@ -14,7 +14,6 @@ setenv =
sqlite: DB_ENGINE=django.db.backends.sqlite3 sqlite: DB_ENGINE=django.db.backends.sqlite3
pg: DB_ENGINE=django.db.backends.postgresql_psycopg2 pg: DB_ENGINE=django.db.backends.postgresql_psycopg2
deps = deps =
django18: django>=1.8,<1.9
django111: django>=1.11,<1.12 django111: django>=1.11,<1.12
psycopg2-binary psycopg2-binary
pytest-cov pytest-cov
@ -36,9 +35,7 @@ deps =
http://quixote.python.ca/releases/Quixote-2.7b2.tar.gz http://quixote.python.ca/releases/Quixote-2.7b2.tar.gz
vobject vobject
django-ratelimit django-ratelimit
django18: django-model-utils<3.2
commands = commands =
./get_wcs.sh ./get_wcs.sh
django18: py.test {posargs: {env:FAST:} --junitxml=test_{envname}_results.xml --cov-report xml --cov-report html --cov=passerelle/ --cov-config .coveragerc tests/} django111: py.test {posargs: {env:FAST:} --junitxml=test_{envname}_results.xml --cov-report xml --cov-report html --cov=passerelle/ --cov-config .coveragerc tests/}
django18: ./pylint.sh passerelle/ django111: ./pylint.sh passerelle/
django111: py.test {posargs: --junitxml=test_{envname}_results.xml tests/}