Skip to content

Commit c095ce1

Browse files
committed
Add Django 1.11 supports again
1 parent bdb9836 commit c095ce1

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def find_version(*file_paths):
3535
packages=[
3636
'timezone_field',
3737
],
38-
install_requires=['django>=2.2', 'pytz'],
38+
install_requires=['django>=1.11', 'pytz'],
3939
extras_require={
4040
'rest_framework': ['djangorestframework>=3.0.0']
4141
},

tests/settings.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@
6969
'default': {
7070
'ENGINE': 'django.db.backends.postgresql_psycopg2',
7171
'NAME': 'timezone_field_tests',
72-
'USER': 'postgres',
72+
'USER': 'test_user',
73+
'PASSWORD': 'test_user',
74+
'HOST': '127.0.0.1',
75+
'PORT': '5599',
7376
},
7477
}
7578

tox.ini

+31-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
[tox]
2+
requires =
3+
tox-docker
24
envlist =
35
coverage-clean,
46
py35-{django22}-{sqlite,postgres},
57
py36-{django22,django30,django31}-{sqlite,postgres},
68
py37-{django22,django30,django31}-{sqlite,postgres},
79
py38-{django22,django30,django31}-{sqlite,postgres},
8-
py39-{django22,django30,django31}-{sqlite,postgres},
10+
py39-{django11,django22,django30,django31}-{sqlite,postgres},
911
coverage-report,
1012
py39-flake8
1113

@@ -14,6 +16,7 @@ commands = coverage run --include='*/timezone_field/*' {envbindir}/django-admin.
1416
deps =
1517
coverage
1618
djangorestframework>=3.0.0
19+
django11: django>=1.11.29,<2.0
1720
django22: django>=2.2.17,<2.3
1821
django30: django>=3.0.0,<3.1
1922
django31: django>=3.1.0,<3.2
@@ -24,6 +27,10 @@ setenv =
2427
sqlite: TEST_DB_ENGINE=sqlite
2528
postgres: TEST_DB_ENGINE=postgres
2629

30+
[testenv:py{35,36,37,38,39}-{django11,django22,django30,django31}-postgres]
31+
docker =
32+
db
33+
2734
[testenv:py39-flake8]
2835
commands = flake8
2936
deps = flake8
@@ -35,3 +42,26 @@ commands = coverage erase
3542
commands =
3643
coverage report
3744
coverage html
45+
46+
[docker:db]
47+
image = docker.io/bitnami/postgresql:13-debian-10
48+
# Environment variables are passed to the container. They are only
49+
# available to that container, and not to the testenv, other
50+
# containers, or as replacements in other parts of tox.ini
51+
environment =
52+
POSTGRESQL_USERNAME=test_user
53+
POSTGRESQL_PASSWORD=test_user
54+
POSTGRESQL_DATABASE=timezone_field_tests
55+
POSTGRES_INITDB_ARGS=--encoding=UTF-8
56+
ports =
57+
5599:5432/tcp
58+
# The healthcheck ensures that tox-docker won't run tests until the
59+
# container is up and the command finishes with exit code 0 (success)
60+
healthcheck_cmd = PGPASSWORD=$POSTGRESQL_PASSWORD psql \
61+
--user=$POSTGRESQL_USERNAME --dbname=$POSTGRESQL_DATABASE \
62+
--host=127.0.0.1 --quiet --no-align --tuples-only \
63+
-1 --command="SELECT 1"
64+
healthcheck_timeout = 1
65+
healthcheck_retries = 30
66+
healthcheck_interval = 1
67+
healthcheck_start_period = 1

0 commit comments

Comments
 (0)