Skip to content

Commit

Permalink
Merge pull request #21 from treyhunner/upgrade-django
Browse files Browse the repository at this point in the history
Upgrade Django version support
  • Loading branch information
treyhunner committed Sep 14, 2021
2 parents 8067484 + 546d11c commit a0d27f1
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 136 deletions.
16 changes: 3 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
language: python

python:
- 3.5
- 3.6
- 3.7
- 3.8
- 3.9

env:
- DJANGO=Django==1.11
- DJANGO=Django==2.0
- DJANGO=Django==2.1
- DJANGO=Django==2.2
- DJANGO=Django==3.0
- DJANGO=Django==3.1
- DJANGO=Django==3.2

install:
- pip install $DJANGO
Expand All @@ -20,12 +19,3 @@ install:
script: coverage run setup.py test

after_success: coveralls

matrix:
exclude:
- python: 3.5
env: DJANGO=Django==3.0
- python: 3.7
env: DJANGO=Django==1.11
- python: 3.8
env: DJANGO=Django==1.11
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ django-relatives

Utilities for linking to related objects in Django admin

This app requires Django 1.11 or greater and Python 3.5 or greater.
This app requires Django 2.2 or greater and Python 3.6 or greater.


Getting Help
Expand Down
2 changes: 1 addition & 1 deletion relatives/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.2.0'
__version__ = '1.2.1'
9 changes: 5 additions & 4 deletions relatives/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,18 @@ def test_generic_foreign_key_present(self):
response = self.client.get(
reverse('admin:tests_image_change', args=[image.id])
)
self.assertIn(b'/adm/tests/book/%d' % book.id, response.content)
self.assertNotIn(b'<p>None</p>', response.content)
self.assertIn(f'/adm/tests/book/{book.id}', response.rendered_content)
self.assertIn(f'Book object ({book.id})', response.rendered_content)
self.assertNotIn('<p>None</p>', response.rendered_content)

def test_generic_foreign_key_not_present(self):
image = Image.objects.create()
self.login()
response = self.client.get(
reverse('admin:tests_image_change', args=[image.id])
)
self.assertNotIn(b'/adm/tests/book/', response.content)
self.assertIn(b'<p>None</p>', response.content)
self.assertIn('<p>None</p>', response.rendered_content)
self.assertNotIn('Book object', response.rendered_content)


class RelatedObjectsTagTest(TestCase):
Expand Down
3 changes: 3 additions & 0 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
'django.contrib.messages.middleware.MessageMiddleware',
],
ROOT_URLCONF='relatives.tests.urls',
SECRET_KEY='secret',
STATIC_URL='/static/',
DEFAULT_AUTO_FIELD='django.db.models.BigAutoField',
TEMPLATES=[
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
Expand All @@ -42,6 +44,7 @@
"context_processors": [
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.request',
]
}
},
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
)),
packages=find_packages(),
include_package_data=True,
install_requires=['Django >= 1.4.2'],
tests_require=['Django >= 1.4.2'],
install_requires=['Django >= 1.11'],
tests_require=['Django >= 1.11'],
test_suite='runtests.runtests',
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand All @@ -27,10 +27,10 @@
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Framework :: Django',
],
)
121 changes: 7 additions & 114 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
[tox]
envlist =
py35-1.11, py35-2.0, py35-2.1, py35-2.2,
py36-1.11, py36-2.0, py36-2.1, py36-2.2, py36-3.0,
py37-2.0, py37-2.1, py37-2.2, py37-3.0,
py38-2.2, py38-3.0, py38-trunk,
py{36,37,38,39}-django{2.2,3.0,3.1,3.2},
docs, flake8, check-manifest


[flake8]
ignore = W503
max-complexity = 8
Expand All @@ -15,6 +11,12 @@ max-line-length = 79

[testenv]
commands = coverage run -a setup.py test
deps =
django2.2: Django>=2.2,<2.3
django3.0: Django>=3.0,<3.1
django3.1: Django>=3.1,<3.2
django3.2: Django>=3.2,<3.3
coverage == 4.5.1


[testenv:flake8]
Expand All @@ -35,112 +37,3 @@ deps =
check-manifest
commands =
check-manifest

[testenv:py35-1.11]
basepython = python3.5
deps =
django == 1.11
coverage == 4.5.1

[testenv:py35-2.0]
basepython = python3.5
deps =
django == 2.0
coverage == 4.5.1

[testenv:py35-2.1]
basepython = python3.5
deps =
django == 2.1
coverage == 4.5.1

[testenv:py35-2.2]
basepython = python3.5
deps =
django == 2.2
coverage == 4.5.1

[testenv:py35-3.0]
basepython = python3.5
deps =
django == 3.0
coverage == 4.5.1

[testenv:py36-1.11]
basepython = python3.6
deps =
django == 1.11
coverage == 4.5.1

[testenv:py36-2.0]
basepython = python3.6
deps =
django == 2.0
coverage == 4.5.1

[testenv:py36-2.1]
basepython = python3.6
deps =
django == 2.1
coverage == 4.5.1

[testenv:py36-2.2]
basepython = python3.6
deps =
django == 2.2
coverage == 4.5.1

[testenv:py36-3.0]
basepython = python3.6
deps =
django == 3.0
coverage == 4.5.1

[testenv:py37-1.11]
basepython = python3.7
deps =
django == 1.11
coverage == 4.5.1

[testenv:py37-2.0]
basepython = python3.7
deps =
django == 2.0
coverage == 4.5.1

[testenv:py37-2.1]
basepython = python3.7
deps =
django == 2.1
coverage == 4.5.1

[testenv:py37-2.2]
basepython = python3.7
deps =
django == 2.2
coverage == 4.5.1

[testenv:py37-3.0]
basepython = python3.7
deps =
django == 3.0
coverage == 4.5.1

[testenv:py38-2.2]
basepython = python3.8
deps =
django == 2.2
coverage == 4.5.1

[testenv:py38-3.0]
basepython = python3.8
deps =
django == 3.0
coverage == 4.5.1


[testenv:py38-trunk]
basepython = python3.8
deps =
https://github.com/django/django/tarball/master
coverage == 4.5.1

0 comments on commit a0d27f1

Please sign in to comment.