Skip to content

Commit 5f8409a

Browse files
committed
Drop support for Django 1.7
1 parent a80dd46 commit 5f8409a

12 files changed

+14
-35
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ matrix:
3939
env: TOXENV=py27-pytest3-django1.9-postgres
4040
- python: 2.7
4141
env: TOXENV=py27-pytest3-django1.8-postgres
42-
- python: 2.7
43-
env: TOXENV=py27-pytest3-django1.7-postgres
4442
- python: 2.7
4543
env: TOXENV=py27-checkqa
4644

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pytest-django allows you to test your Django project/applications with the
2222
<https://pytest-django.readthedocs.io/en/latest/contributing.html>`_
2323
* Version compatibility:
2424

25-
* Django: 1.7-1.11 and latest master branch (compatible at the time of each release)
25+
* Django: 1.8-1.11 and latest master branch (compatible at the time of each release)
2626
* Python: CPython 2.7,3.3-3.6 or PyPy 2,3
2727
* pytest: >2.9.x
2828

docs/contributing.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ writing), running them all will take a long time. All valid configurations can
137137
be found in `tox.ini`. To test against a few of them, invoke tox with the `-e`
138138
flag::
139139

140-
$ tox -e python3.3-1.7-postgres,python2.7-1.9-sqlite
140+
$ tox -e python3.6-1.11-postgres,python2.7-1.11-mysql_innodb
141141

142-
This will run the tests on Python 3.3/Django 1.7/PostgeSQL and Python
143-
2.7/Django 1.9/SQLite.
142+
This will run the tests on Python 3.6/Django 1.11/PostgeSQL and Python
143+
2.7/Django 1.11/MySQL.
144144

145145

146146
Measuring test coverage

docs/helpers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ when trying to access the database.
8585
If you run pytest using the ``--fail-on-template-vars`` option,
8686
tests will fail should your templates contain any invalid variables.
8787
This marker will disable this feature by setting ``settings.TEMPLATE_STRING_IF_INVALID=None``
88-
or the ``string_if_invalid`` template option in Django>=1.7
88+
or the ``string_if_invalid`` template option
8989

9090
Example usage::
9191

docs/managing_python_path.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ add this directly to your project's requirements.txt file like this::
7171

7272
# requirements.txt
7373
-e .
74-
django>=1.7
74+
django>=1.11
7575
pytest-django
7676

7777

pytest_django/compat.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# This file cannot be imported from until Django sets up
2+
from django.db.backends.base.base import BaseDatabaseWrapper
23

34
try:
45
# Django 1.11
@@ -11,9 +12,3 @@ def teardown_databases(db_cfg, verbosity):
1112
(_DiscoverRunner(verbosity=verbosity,
1213
interactive=False)
1314
.teardown_databases(db_cfg))
14-
15-
try:
16-
from django.db.backends.base.base import BaseDatabaseWrapper # noqa
17-
except ImportError:
18-
# Django 1.7.
19-
from django.db.backends import BaseDatabaseWrapper # noqa

pytest_django/fixtures.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,7 @@ def django_db_setup(
8383
_disable_native_migrations()
8484

8585
if django_db_keepdb:
86-
if get_django_version() >= (1, 8):
87-
setup_databases_args['keepdb'] = True
88-
else:
89-
# Django 1.7 compatibility
90-
from .db_reuse import monkey_patch_creation_for_db_reuse
91-
92-
with django_db_blocker.unblock():
93-
monkey_patch_creation_for_db_reuse()
86+
setup_databases_args['keepdb'] = True
9487

9588
with django_db_blocker.unblock():
9689
db_cfg = setup_databases(

pytest_django/plugin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ def pytest_addoption(parser):
6363
help='Set DJANGO_CONFIGURATION.')
6464
group._addoption('--nomigrations', '--no-migrations',
6565
action='store_true', dest='nomigrations', default=False,
66-
help='Disable Django 1.7+ migrations on test setup')
66+
help='Disable Django migrations on test setup')
6767
group._addoption('--migrations',
6868
action='store_false', dest='nomigrations', default=False,
69-
help='Enable Django 1.7+ migrations on test setup')
69+
help='Enable Django migrations on test setup')
7070
parser.addini(CONFIGURATION_ENV,
7171
'django-configurations class to use by pytest-django.')
7272
group._addoption('--liveserver', default=None,
@@ -540,7 +540,7 @@ def __mod__(self, var):
540540
django_settings_is_configured()):
541541
from django.conf import settings as dj_settings
542542

543-
if get_django_version() >= (1, 8) and dj_settings.TEMPLATES:
543+
if dj_settings.TEMPLATES:
544544
dj_settings.TEMPLATES[0]['OPTIONS']['string_if_invalid'] = (
545545
InvalidVarException())
546546
else:
@@ -556,7 +556,7 @@ def _template_string_if_invalid_marker(request):
556556
if marker and django_settings_is_configured():
557557
from django.conf import settings as dj_settings
558558

559-
if get_django_version() >= (1, 8) and dj_settings.TEMPLATES:
559+
if dj_settings.TEMPLATES:
560560
dj_settings.TEMPLATES[0]['OPTIONS']['string_if_invalid'].fail = False
561561
else:
562562
dj_settings.TEMPLATE_STRING_IF_INVALID.fail = False

tests/test_db_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def test_inner():
223223

224224

225225
class TestNativeMigrations(object):
226-
""" Tests for Django 1.7 Migrations """
226+
""" Tests for Django Migrations """
227227

228228
def test_no_migrations(self, django_testdir):
229229
django_testdir.create_test_module('''

tests/test_environment.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,6 @@ def test_more_verbose_with_vv_and_reusedb(self, testdir):
225225
not in result.stdout.str())
226226

227227

228-
@pytest.mark.skipif(
229-
get_django_version() < (1, 8),
230-
reason='Django 1.7 requires settings.SITE_ID to be set, so this test is invalid'
231-
)
232228
@pytest.mark.django_db
233229
@pytest.mark.parametrize('site_name', ['site1', 'site2'])
234230
def test_clear_site_cache(site_name, rf, monkeypatch):

tests/test_fixtures.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,6 @@ def test_a(self, live_server, settings):
310310
result.stdout.fnmatch_lines(['*test_a*PASSED*'])
311311
assert result.ret == 0
312312

313-
@pytest.mark.skipif(get_django_version() < (1, 7),
314-
reason="Django >= 1.7 required")
315313
def test_serve_static_dj17_without_staticfiles_app(self, live_server,
316314
settings):
317315
"""

tox.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ envlist =
44
- py34-pytest3-django{1.11,1.10}-postgres
55
- py33-pytest3-django1.8-postgres
66
- py27-pytest3-django{1.11,1.10}-{mysql_innodb,mysql_myisam,postgres}
7-
- py27-pytest3-django{1.11,1.10,1.9,1.8,1.7}-postgres
7+
- py27-pytest3-django{1.11,1.10,1.9,1.8}-postgres
88
- pypy3-pytest3-django1.8-{sqlite,sqlite_file}
99
- pypy3-pytest2-django1.8-sqlite_file
1010
- pypy-pytest3-django1.10-sqlite_file
@@ -23,7 +23,6 @@ deps =
2323
django1.10: Django>=1.10,<1.11
2424
django1.9: Django>=1.9,<1.10
2525
django1.8: Django>=1.8,<1.9
26-
django1.7: Django>=1.7,<1.8
2726

2827
mysql_myisam: mysql-python==1.2.5
2928
mysql_innodb: mysql-python==1.2.5

0 commit comments

Comments
 (0)