Skip to content

Commit

Permalink
Added support for Django 3 (django-cms#181)
Browse files Browse the repository at this point in the history
* added support for Django 3

* running isort

* update reqs

* fiy tests

* downgrade appconf
  • Loading branch information
FinalAngel authored Apr 21, 2020
1 parent c624821 commit fb65985
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Changelog
2.6.0 (unreleased)
==================

* Added support for Django 3.0
* Added support for Python 3.8
* Pinned ``django-filer`` to 1.5.0
* Added further tests to raise coverage
* Fixed smaller issues found during testing
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ You can run tests by executing::

.. |python| image:: https://img.shields.io/badge/python-2.7%20%7C%203.4+-blue.svg
:target: https://pypi.org/project/djangocms-link/
.. |django| image:: https://img.shields.io/badge/django-1.11%20%7C%202.1%20%7C%202.2-blue.svg
.. |django| image:: https://img.shields.io/badge/django-1.11%20%7C%202.2%20%7C%203.0-blue.svg
:target: https://www.djangoproject.com/
.. |djangocms| image:: https://img.shields.io/badge/django%20CMS-3.4%2B-blue.svg
:target: https://www.django-cms.org/
3 changes: 2 additions & 1 deletion djangocms_link/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.encoding import force_text
from django.utils.translation import ugettext
from django.utils.translation import ugettext_lazy as _

from cms.models import CMSPlugin, Page

from djangocms_attributes_field.fields import AttributesField
from filer.fields.file import FilerFileField
from six import python_2_unicode_compatible

from .validators import IntranetURLValidator

Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Framework :: Django',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.1',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django CMS',
'Framework :: Django CMS :: 3.4',
'Framework :: Django CMS :: 3.5',
Expand Down
5 changes: 2 additions & 3 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ django-select2>=5.11,<7 # 7 works in Django 2+
django-filer>=1.5.0
djangocms-text-ckeditor
html5lib<0.99999999
djangocms-helper
django-app-helper
tox
coverage
isort
flake8
# override "pyflakes<2.1" from djangocms-helper
pyflakes>=2.1.0
pyflakes>=2.1
2 changes: 1 addition & 1 deletion tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@


def run():
from djangocms_helper import runner
from app_helper import runner
runner.cms('djangocms_link')


Expand Down
2 changes: 1 addition & 1 deletion tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.conf import settings
from django.test import TestCase

from djangocms_link.fields import is_select2_enabled, PageSearchField
from djangocms_link.fields import PageSearchField, is_select2_enabled
from djangocms_link.fields_select2 import Select2PageSearchField


Expand Down
5 changes: 3 additions & 2 deletions tests/test_migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
# http://tech.octopus.energy/news/2016/01/21/testing-for-missing-migrations-in-django.html
from django.core.management import call_command
from django.test import TestCase, override_settings
from django.utils.six import text_type
from django.utils.six.moves import StringIO

from six import text_type
from six.moves import StringIO


class MigrationTestCase(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from cms.api import create_page

from djangocms_link.models import Link, TARGET_CHOICES
from djangocms_link.models import TARGET_CHOICES, Link

from .helpers import get_filer_file

Expand Down
2 changes: 1 addition & 1 deletion tests/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from cms.models import Placeholder, StaticPlaceholder
from cms.test_utils.testcases import CMSTestCase

from djangocms_link.models import AbstractLink
from djangocms_link.cms_plugins import LinkPlugin
from djangocms_link.models import AbstractLink

from .helpers import get_filer_file

Expand Down
2 changes: 1 addition & 1 deletion tests/test_validators.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
from django.test import TestCase

from djangocms_link.validators import IntranetURLValidator
from djangocms_link.models import HOSTNAME
from djangocms_link.validators import IntranetURLValidator


class LinkValidatorTestCase(TestCase):
Expand Down
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
envlist =
flake8
isort
py{27,34,35,36}-dj111-cms{34,35,36}
py{27,35,36}-dj111-cms{35,36}
py{27,35,36}-dj111-cms37
py{35,36,37}-dj{21,22}-cms{36,37}

Expand Down Expand Up @@ -41,12 +41,14 @@ known_django = django
deps =
-r{toxinidir}/tests/requirements.txt
dj111: Django>=1.11,<2.0
dj111: django-formtools>=2.0,<2.1
dj111: django-appconf<=1.0.2
dj21: Django>=2.1,<2.2
dj22: Django>=2.2,<3.0
cms34: django-cms>=3.4,<3.5
cms35: django-cms>=3.5,<3.6
cms36: django-cms>=3.6,<3.7
cms37: https://github.com/divio/django-cms/archive/release/3.7.x.zip
cms37: django-cms>=3.7,<3.8
commands =
{envpython} --version
{env:COMMAND:coverage} erase
Expand Down

0 comments on commit fb65985

Please sign in to comment.