From bbf755a08f4eb5cc3fcb28bf51f9063dda4912d8 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 28 Jan 2021 18:04:35 +0100 Subject: [PATCH 1/7] Move tests into root tests directory. --- MANIFEST.in | 2 +- docs/installation.rst | 2 +- {testtinymce => tests}/__init__.py | 0 {testtinymce => tests}/manage.py | 2 +- {testtinymce => tests}/settings.py | 9 ++++---- {tinymce/tests => tests}/test_compressor.py | 0 {tinymce/tests => tests}/test_models.py | 2 +- {tinymce/tests => tests}/test_views.py | 0 {tinymce/tests => tests}/test_widgets.py | 0 {testtinymce => tests}/testapp/__init__.py | 0 {testtinymce => tests}/testapp/admin.py | 2 +- .../testapp/migrations/0001_initial.py | 0 tests/testapp/migrations/0002_testmodel.py | 21 +++++++++++++++++++ .../testapp/migrations/__init__.py | 0 {testtinymce => tests}/testapp/models.py | 5 +++++ .../testapp/templates/flatpages/default.html | 0 {testtinymce => tests}/urls.py | 0 testtinymce/testapp/views.py | 1 - tinymce/tests/__init__.py | 0 tinymce/tests/models.py | 7 ------- 20 files changed, 35 insertions(+), 18 deletions(-) rename {testtinymce => tests}/__init__.py (100%) rename {testtinymce => tests}/manage.py (86%) rename {testtinymce => tests}/settings.py (93%) rename {tinymce/tests => tests}/test_compressor.py (100%) rename {tinymce/tests => tests}/test_models.py (90%) rename {tinymce/tests => tests}/test_views.py (100%) rename {tinymce/tests => tests}/test_widgets.py (100%) rename {testtinymce => tests}/testapp/__init__.py (100%) rename {testtinymce => tests}/testapp/admin.py (96%) rename {testtinymce => tests}/testapp/migrations/0001_initial.py (100%) create mode 100644 tests/testapp/migrations/0002_testmodel.py rename {testtinymce => tests}/testapp/migrations/__init__.py (100%) rename {testtinymce => tests}/testapp/models.py (71%) rename {testtinymce => tests}/testapp/templates/flatpages/default.html (100%) rename {testtinymce => tests}/urls.py (100%) delete mode 100644 testtinymce/testapp/views.py delete mode 100644 tinymce/tests/__init__.py delete mode 100644 tinymce/tests/models.py diff --git a/MANIFEST.in b/MANIFEST.in index b16104e6..cc6584e5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include *.txt *.py *.rst setup.cfg include docs/*.rst exclude *.pyc -recursive-include testtinymce * +recursive-include tests * recursive-include tinymce * diff --git a/docs/installation.rst b/docs/installation.rst index aa316da8..5e95b5f1 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -79,7 +79,7 @@ Verify that everything is installed and configured properly: #. Setup environment variable ``DJANGO_SETTINGS_MODULE``:: - export DJANGO_SETTINGS_MODULE='testtinymce.settings' + export DJANGO_SETTINGS_MODULE='tests.settings' #. Create project and change into project directory:: diff --git a/testtinymce/__init__.py b/tests/__init__.py similarity index 100% rename from testtinymce/__init__.py rename to tests/__init__.py diff --git a/testtinymce/manage.py b/tests/manage.py similarity index 86% rename from testtinymce/manage.py rename to tests/manage.py index 38b3ccc9..8ab7a9ed 100755 --- a/testtinymce/manage.py +++ b/tests/manage.py @@ -3,7 +3,7 @@ import sys try: - os.environ["DJANGO_SETTINGS_MODULE"] = "testtinymce.settings" + os.environ["DJANGO_SETTINGS_MODULE"] = "tests.settings" test_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, test_dir) except ImportError: diff --git a/testtinymce/settings.py b/tests/settings.py similarity index 93% rename from testtinymce/settings.py rename to tests/settings.py index d4f11452..2c15586a 100644 --- a/testtinymce/settings.py +++ b/tests/settings.py @@ -1,5 +1,3 @@ -# Django settings for testtinymce project. - from os.path import dirname, join, realpath ROOT_PATH = dirname(realpath(__file__)) @@ -8,7 +6,7 @@ DATABASES = { "default": { "ENGINE": "django.db.backends.sqlite3", - "NAME": join(ROOT_PATH, "testtinymce.sqlite"), + "NAME": join(ROOT_PATH, "tests.sqlite"), "USER": "", "PASSWORD": "", "HOST": "", @@ -49,6 +47,7 @@ "APP_DIRS": True, "OPTIONS": { "context_processors": [ + "django.template.context_processors.request", "django.contrib.auth.context_processors.auth", "django.contrib.messages.context_processors.messages", ] @@ -58,7 +57,7 @@ SECRET_KEY = "w4o4x^&b4h4zne9&3b1m-_p-=+&n_i_sdf@oz=gd+6h6v1$sd9" -ROOT_URLCONF = "testtinymce.urls" +ROOT_URLCONF = "tests.urls" INSTALLED_APPS = ( "django.contrib.auth", @@ -70,7 +69,7 @@ "django.contrib.admin", "django.contrib.flatpages", "tinymce", - "testtinymce.testapp", + "tests.testapp", ) TINYMCE_SPELLCHECKER = True diff --git a/tinymce/tests/test_compressor.py b/tests/test_compressor.py similarity index 100% rename from tinymce/tests/test_compressor.py rename to tests/test_compressor.py diff --git a/tinymce/tests/test_models.py b/tests/test_models.py similarity index 90% rename from tinymce/tests/test_models.py rename to tests/test_models.py index 4261d957..d4425295 100644 --- a/tinymce/tests/test_models.py +++ b/tests/test_models.py @@ -4,7 +4,7 @@ from tinymce.widgets import AdminTinyMCE -from .models import TestModel +from tests.testapp.models import TestModel class TestModels(SimpleTestCase): diff --git a/tinymce/tests/test_views.py b/tests/test_views.py similarity index 100% rename from tinymce/tests/test_views.py rename to tests/test_views.py diff --git a/tinymce/tests/test_widgets.py b/tests/test_widgets.py similarity index 100% rename from tinymce/tests/test_widgets.py rename to tests/test_widgets.py diff --git a/testtinymce/testapp/__init__.py b/tests/testapp/__init__.py similarity index 100% rename from testtinymce/testapp/__init__.py rename to tests/testapp/__init__.py diff --git a/testtinymce/testapp/admin.py b/tests/testapp/admin.py similarity index 96% rename from testtinymce/testapp/admin.py rename to tests/testapp/admin.py index b695cdca..93ec06e8 100644 --- a/testtinymce/testapp/admin.py +++ b/tests/testapp/admin.py @@ -3,7 +3,7 @@ from django.contrib.flatpages.models import FlatPage from django.urls import reverse -from testtinymce.testapp.models import TestInline, TestPage +from tests.testapp.models import TestInline, TestPage from tinymce.widgets import TinyMCE diff --git a/testtinymce/testapp/migrations/0001_initial.py b/tests/testapp/migrations/0001_initial.py similarity index 100% rename from testtinymce/testapp/migrations/0001_initial.py rename to tests/testapp/migrations/0001_initial.py diff --git a/tests/testapp/migrations/0002_testmodel.py b/tests/testapp/migrations/0002_testmodel.py new file mode 100644 index 00000000..e71fecce --- /dev/null +++ b/tests/testapp/migrations/0002_testmodel.py @@ -0,0 +1,21 @@ +# Generated by Django 2.2.17 on 2021-01-28 10:51 + +from django.db import migrations, models +import tinymce.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('testapp', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='TestModel', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('foobar', tinymce.models.HTMLField()), + ], + ), + ] diff --git a/testtinymce/testapp/migrations/__init__.py b/tests/testapp/migrations/__init__.py similarity index 100% rename from testtinymce/testapp/migrations/__init__.py rename to tests/testapp/migrations/__init__.py diff --git a/testtinymce/testapp/models.py b/tests/testapp/models.py similarity index 71% rename from testtinymce/testapp/models.py rename to tests/testapp/models.py index ac304b53..dc11d7ba 100644 --- a/testtinymce/testapp/models.py +++ b/tests/testapp/models.py @@ -1,4 +1,9 @@ from django.db import models +from tinymce import models as tinymce_models + + +class TestModel(models.Model): + foobar = tinymce_models.HTMLField() class TestPage(models.Model): diff --git a/testtinymce/testapp/templates/flatpages/default.html b/tests/testapp/templates/flatpages/default.html similarity index 100% rename from testtinymce/testapp/templates/flatpages/default.html rename to tests/testapp/templates/flatpages/default.html diff --git a/testtinymce/urls.py b/tests/urls.py similarity index 100% rename from testtinymce/urls.py rename to tests/urls.py diff --git a/testtinymce/testapp/views.py b/testtinymce/testapp/views.py deleted file mode 100644 index 60f00ef0..00000000 --- a/testtinymce/testapp/views.py +++ /dev/null @@ -1 +0,0 @@ -# Create your views here. diff --git a/tinymce/tests/__init__.py b/tinymce/tests/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tinymce/tests/models.py b/tinymce/tests/models.py deleted file mode 100644 index 9497d562..00000000 --- a/tinymce/tests/models.py +++ /dev/null @@ -1,7 +0,0 @@ -from django.db import models - -from tinymce import models as tinymce_models - - -class TestModel(models.Model): - foobar = tinymce_models.HTMLField() From 3e45b2402793e05cd1fb90aff4644ee822d5a15e Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 28 Jan 2021 18:11:22 +0100 Subject: [PATCH 2/7] Migrate to GitHub Actions. This also gets rid of the duplicate test setup with the Makefile/profile. Tox is the way to go. --- .coveragerc | 3 +++ .github/workflows/test.yml | 52 ++++++++++++++++++++++++++++++++++++ .gitignore | 1 + Makefile | 54 -------------------------------------- docs/usage.rst | 4 +-- profile | 3 --- setup.py | 1 - tests/settings.py | 2 ++ tinymce/views.py | 4 +-- tinymce/widgets.py | 4 +-- tox.ini | 26 ++++++++++-------- 11 files changed, 79 insertions(+), 75 deletions(-) create mode 100644 .coveragerc create mode 100644 .github/workflows/test.yml delete mode 100644 Makefile delete mode 100644 profile diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..fad63e2c --- /dev/null +++ b/.coveragerc @@ -0,0 +1,3 @@ +[run] +source = tinymce +branch = True diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..ea9b9fd3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,52 @@ +name: Test + +on: [push, pull_request] + +jobs: + build: + name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + max-parallel: 5 + matrix: + python-version: ['3.6', '3.7', '3.8', '3.9'] + django-version: ['2.2', '3.0', '3.1', 'dev'] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: Cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: + ${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }} + restore-keys: | + ${{ matrix.python-version }}-v1- + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade tox tox-gh-actions + + - name: Tox tests + run: | + tox -v + env: + DJANGO: ${{ matrix.django-version }} + + - name: Upload coverage + uses: codecov/codecov-action@v1 + with: + name: Python ${{ matrix.python-version }} diff --git a/.gitignore b/.gitignore index 3521ba0e..a7b3e1ba 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ .venv/ __pycache__/ .tox/ +coverage.xml diff --git a/Makefile b/Makefile deleted file mode 100644 index 46643a79..00000000 --- a/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -VIRTUALENV = virtualenv -VENV := $(shell echo $${VIRTUAL_ENV-.venv}) -PYTHON = $(VENV)/bin/python -DEV_STAMP = $(VENV)/.dev_env_installed.stamp -INSTALL_STAMP = $(VENV)/.install.stamp - -.IGNORE: clean distclean maintainer-clean -.PHONY: all install virtualenv tests - -OBJECTS = .venv .coverage - -all: install -install: $(INSTALL_STAMP) -$(INSTALL_STAMP): $(PYTHON) setup.py - $(VENV)/bin/pip install -U pip django flake8 pyenchant coverage - $(VENV)/bin/pip install -Ue . - touch $(INSTALL_STAMP) - -install-dev: $(INSTALL_STAMP) $(DEV_STAMP) setup.py -$(DEV_STAMP): $(PYTHON) - $(VENV)/bin/pip install django flake8 pyenchant coverage tox - touch $(DEV_STAMP) - -virtualenv: $(PYTHON) -$(PYTHON): - $(VIRTUALENV) $(VENV) - -tests-once: install-dev - $(VENV)/bin/coverage run --source=tinymce setup.py test - $(VENV)/bin/coverage report - -tests: install-dev tox.ini - $(VENV)/bin/tox - -flake8: install-dev - $(VENV)/bin/flake8 tinymce --ignore=E501,E402 - -clean: - find . -name '*.pyc' -delete - find . -name '__pycache__' -type d | xargs rm -fr - -distclean: clean - rm -fr *.egg *.egg-info/ - -maintainer-clean: distclean - rm -fr .venv/ .tox/ dist/ build/ - -serve: - ./testtinymce/manage.py migrate - ./testtinymce/manage.py createsuperuser --username admin --email "test@tinymce.com" --no-input 2>/dev/null || exit 0 - ./testtinymce/manage.py runserver - -passwd: - ./testtinymce/manage.py changepassword admin diff --git a/docs/usage.rst b/docs/usage.rst index 23198800..90450cd0 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -219,7 +219,7 @@ The source contains a `test project`_ that includes this flatpages model admin. #. Checkout django-tinymce: ``git clone https://github.com/jazzband/django-tinymce.git`` #. Go to the test project: - ``cd django-tinymce/testtinymce`` + ``cd django-tinymce/tests`` #. Copy the ``tiny_mce`` directory from the TinyMCE distribution into ``media/js`` #. Run ``python manage.py migrate`` @@ -228,5 +228,5 @@ The source contains a `test project`_ that includes this flatpages model admin. #. Connect to `http://localhost:8000/admin/`_ and login with the above-created user. -.. _`test project`: https://github.com/jazzband/django-tinymce/tree/master/testtinymce +.. _`test project`: https://github.com/jazzband/django-tinymce/tree/master/tests .. _`http://localhost:8000/admin/`: http://localhost:8000/admin/ diff --git a/profile b/profile deleted file mode 100644 index b3f316f8..00000000 --- a/profile +++ /dev/null @@ -1,3 +0,0 @@ -export DJANGO_SETTINGS_MODULE=testtinymce.settings -export PYTHONPATH=$PWD:$PWD/testtinymce:$PYTHONPATH -source env/bin/activate diff --git a/setup.py b/setup.py index a8eab072..5a23ba5f 100755 --- a/setup.py +++ b/setup.py @@ -51,5 +51,4 @@ def read_file(filename): ], platforms=["any"], url="https://github.com/jazzband/django-tinymce", - test_suite="runtests.runtests", ) diff --git a/tests/settings.py b/tests/settings.py index 2c15586a..ebb3f6ec 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -86,3 +86,5 @@ "alignright alignjustify | bullist numlist outdent indent | " "removeformat | help", } + +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" diff --git a/tinymce/views.py b/tinymce/views.py index 1401ba5c..8c39abc4 100644 --- a/tinymce/views.py +++ b/tinymce/views.py @@ -7,7 +7,7 @@ from django.http import HttpResponse from django.shortcuts import render from django.urls import reverse -from django.utils.encoding import force_text +from django.utils.encoding import force_str from django.utils.translation import gettext as _ from django.views.decorators.csrf import csrf_exempt @@ -28,7 +28,7 @@ def spell_check(request): if not enchant: raise RuntimeError("install pyenchant for spellchecker functionality") - raw = force_text(request.body) + raw = force_str(request.body) input = json.loads(raw) id = input["id"] method = input["method"] diff --git a/tinymce/widgets.py b/tinymce/widgets.py index 9d51143d..18241863 100644 --- a/tinymce/widgets.py +++ b/tinymce/widgets.py @@ -15,7 +15,7 @@ from django.contrib.admin import widgets as admin_widgets from django.forms.utils import flatatt from django.urls import reverse -from django.utils.encoding import force_text +from django.utils.encoding import force_str from django.utils.html import escape from django.utils.safestring import mark_safe from django.utils.translation import get_language, gettext as _, to_locale @@ -75,7 +75,7 @@ def get_mce_config(self, attrs): def render(self, name, value, attrs=None, renderer=None): if value is None: value = "" - value = force_text(value) + value = force_str(value) final_attrs = self.build_attrs(self.attrs, attrs) final_attrs["name"] = name if final_attrs.get("class", None) is None: diff --git a/tox.ini b/tox.ini index 1d38e3aa..d8ae7939 100644 --- a/tox.ini +++ b/tox.ini @@ -1,26 +1,30 @@ [tox] envlist = - py36-django{22,30,31}, - py37-django{22,30,31}, - py38-django{22,30,31}, - py39-django{22,30,31}, + py{36,37,38,39}-dj{22,30,31,dev} flake8 [testenv] deps = - django22: Django>=2.2,<3.0 - django30: Django>=3.0,<3.1 - django31: Django>=3.1,<3.2 + dj22: Django>=2.2,<3.0 + dj30: Django>=3.0,<3.1 + dj31: Django>=3.1,<3.2 + djdev: https://github.com/django/django/archive/master.tar.gz coverage pyenchant +usedevelop = True +ignore_outcome = + djdev: True commands = - python setup.py develop - coverage run --branch --source=tinymce setup.py test - coverage report -m --omit=tinymce/test* + coverage run {envbindir}/django-admin test + coverage report -m + coverage xml pip freeze +setenv = + DJANGO_SETTINGS_MODULE=tests.settings + PYTHONPATH={toxinidir} [testenv:flake8] deps = flake8 commands = - flake8 tinymce --ignore=E501,E402 + flake8 tinymce --ignore=E501,E402,W503 From 8e2c46fa2cf1e2c752d4c17b149b247c27ccc01a Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 28 Jan 2021 18:11:59 +0100 Subject: [PATCH 3/7] Add release workflow. --- .github/workflows/release.yml | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ff38c768 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,53 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + build: + if: github.repository == 'jazzband/django-tinymce' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Get pip cache dir + id: pip-cache + run: | + echo "::set-output name=dir::$(pip cache dir)" + + - name: Cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: release-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }} + restore-keys: | + release- + + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -U setuptools twine wheel + + - name: Build package + run: | + python setup.py --version + python setup.py sdist --format=gztar bdist_wheel + twine check dist/* + + - name: Upload packages to Jazzband + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: jazzband + password: ${{ secrets.JAZZBAND_RELEASE_KEY }} + repository_url: https://jazzband.co/projects/django-tinymce/upload From 5a8cd07f5b21e7801c4c96c30476fda3adba5811 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 28 Jan 2021 18:14:09 +0100 Subject: [PATCH 4/7] Add gh-actions matrix map. --- tox.ini | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tox.ini b/tox.ini index d8ae7939..f83b8dc2 100644 --- a/tox.ini +++ b/tox.ini @@ -28,3 +28,17 @@ deps = flake8 commands = flake8 tinymce --ignore=E501,E402,W503 + +[gh-actions] +python = + 3.6: py36 + 3.7: py37, flake8 + 3.8: py38 + 3.9: py39 + +[gh-actions:env] +DJANGO = + 2.2: dj22 + 3.0: dj30 + 3.1: dj31 + dev: djdev From eda01e2d7edf290e8147f3cdd4055f31e549177c Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 28 Jan 2021 18:23:13 +0100 Subject: [PATCH 5/7] Run pre-commit. --- .github/workflows/lint.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..c13d2f61 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,12 @@ +name: Lint + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: pre-commit/action@v2.0.0 From d1929c75a62af14242785776b8506271c6b59a25 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Thu, 28 Jan 2021 18:25:43 +0100 Subject: [PATCH 6/7] Fix lint errors. --- tests/test_models.py | 3 +-- tests/testapp/migrations/0002_testmodel.py | 14 ++++++++++---- tests/testapp/models.py | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/test_models.py b/tests/test_models.py index d4425295..74ccfdca 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -2,9 +2,8 @@ from django.contrib.admin.sites import AdminSite from django.test import SimpleTestCase -from tinymce.widgets import AdminTinyMCE - from tests.testapp.models import TestModel +from tinymce.widgets import AdminTinyMCE class TestModels(SimpleTestCase): diff --git a/tests/testapp/migrations/0002_testmodel.py b/tests/testapp/migrations/0002_testmodel.py index e71fecce..967a6b92 100644 --- a/tests/testapp/migrations/0002_testmodel.py +++ b/tests/testapp/migrations/0002_testmodel.py @@ -1,21 +1,27 @@ # Generated by Django 2.2.17 on 2021-01-28 10:51 from django.db import migrations, models + import tinymce.models class Migration(migrations.Migration): dependencies = [ - ('testapp', '0001_initial'), + ("testapp", "0001_initial"), ] operations = [ migrations.CreateModel( - name='TestModel', + name="TestModel", fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('foobar', tinymce.models.HTMLField()), + ( + "id", + models.AutoField( + auto_created=True, primary_key=True, serialize=False, verbose_name="ID" + ), + ), + ("foobar", tinymce.models.HTMLField()), ], ), ] diff --git a/tests/testapp/models.py b/tests/testapp/models.py index dc11d7ba..66c5c92a 100644 --- a/tests/testapp/models.py +++ b/tests/testapp/models.py @@ -1,4 +1,5 @@ from django.db import models + from tinymce import models as tinymce_models From 5e8e40caa1751ef541c2428f200b0b7260c57c74 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Wed, 10 Mar 2021 13:51:37 +0100 Subject: [PATCH 7/7] Rename Django's dev branch to main. --- .github/workflows/test.yml | 2 +- tox.ini | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea9b9fd3..6765bee9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: max-parallel: 5 matrix: python-version: ['3.6', '3.7', '3.8', '3.9'] - django-version: ['2.2', '3.0', '3.1', 'dev'] + django-version: ['2.2', '3.0', '3.1', 'main'] steps: - uses: actions/checkout@v2 diff --git a/tox.ini b/tox.ini index f83b8dc2..6d71b808 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,7 @@ [tox] envlist = - py{36,37,38,39}-dj{22,30,31,dev} + py{36,37,38,39}-dj{22,30,31} + py{38,39}-djmain flake8 [testenv] @@ -8,12 +9,12 @@ deps = dj22: Django>=2.2,<3.0 dj30: Django>=3.0,<3.1 dj31: Django>=3.1,<3.2 - djdev: https://github.com/django/django/archive/master.tar.gz + djmain: https://github.com/django/django/archive/main.tar.gz coverage pyenchant usedevelop = True ignore_outcome = - djdev: True + djmain: True commands = coverage run {envbindir}/django-admin test coverage report -m @@ -41,4 +42,4 @@ DJANGO = 2.2: dj22 3.0: dj30 3.1: dj31 - dev: djdev + main: djmain