Repository: django-wiki/django-wiki

Issue:
Known issue: sorl-thumbnail does not support Django 3.0
Need to create upstream support. Here's a recipe for adding Django 3.0 for their test framework.

https://github.com/jazzband/sorl-thumbnail/commit/22ccd9781462a820f963f57018ad3dcef85053ed

There are imports in Sorl that are broken in Django 3.0:

https://github.com/jazzband/sorl-thumbnail/blob/master/sorl/thumbnail/images.py#L10


Discussion:
The fix has been merged and is available, but the maintainer has not created a release yet. See here for more information: https://github.com/jazzband/sorl-thumbnail/issues/601
Still waiting for a new release.
Hello - has there been any movement on getting the dependencies supported for Django 3?
sorl-thumbnail 12.6.2 is on PyPI and support django 3.0+

django-mptt  has 0.11 released on PyPI and should contain DJango 3.0 support.

is there anything else blocking django 3? would like to be able to activate my wiki again on my django 3 project.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -22,13 +22,13 @@ def get_path(fname):
 
 
 install_requirements = [
-    "Django>=1.11,<2.3",
+    "Django>=1.11,<3.1",
     "bleach>=3.1.0,<3.2",
     "Pillow",
     "django-nyt>=1.1.5,<1.2",
-    "django-mptt>=0.9,<0.10",
+    "django-mptt>=0.11,<0.12",
     "django-sekizai>=0.10",
-    "sorl-thumbnail>=12,<13",
+    "sorl-thumbnail>=12.6.2,<13",
     "Markdown>=3.1,<3.2.0",
 ]
 
@@ -49,9 +49,7 @@ def get_path(fname):
     "pytest-runner",
 ]
 
-development_requirements = (
-    test_requirements + test_lint_requirements + ["pre-commit",]
-)
+development_requirements = test_requirements + test_lint_requirements + ["pre-commit"]
 
 extras_requirements = {
     "devel": development_requirements,
diff --git a/src/wiki/migrations/0003_mptt_upgrade.py b/src/wiki/migrations/0003_mptt_upgrade.py
new file mode 100644
--- /dev/null
+++ b/src/wiki/migrations/0003_mptt_upgrade.py
@@ -0,0 +1,30 @@
+# Upgrades fields changed in django-mptt
+# See: https://github.com/django-mptt/django-mptt/pull/578
+# Generated by Django 2.2.7 on 2020-02-06 20:36
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ("wiki", "0002_urlpath_moved_to"),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name="urlpath",
+            name="level",
+            field=models.PositiveIntegerField(editable=False),
+        ),
+        migrations.AlterField(
+            model_name="urlpath",
+            name="lft",
+            field=models.PositiveIntegerField(editable=False),
+        ),
+        migrations.AlterField(
+            model_name="urlpath",
+            name="rght",
+            field=models.PositiveIntegerField(editable=False),
+        ),
+    ]
diff --git a/src/wiki/plugins/attachments/forms.py b/src/wiki/plugins/attachments/forms.py
--- a/src/wiki/plugins/attachments/forms.py
+++ b/src/wiki/plugins/attachments/forms.py
@@ -87,13 +87,6 @@ class AttachmentArchiveForm(AttachmentForm):
         required=False,
     )
 
-    def __init__(self, *args, **kwargs):
-        super().__init__(*args, **kwargs)
-        ordered_fields = ["unzip_archive", "file"]
-        self.fields.keyOrder = ordered_fields + [
-            k for k in self.fields.keys() if k not in ordered_fields
-        ]
-
     def clean_file(self):
         uploaded_file = self.cleaned_data.get("file", None)
         if uploaded_file and self.cleaned_data.get("unzip_archive", False):


Test patch:
diff --git a/tests/core/test_accounts.py b/tests/core/test_accounts.py
--- a/tests/core/test_accounts.py
+++ b/tests/core/test_accounts.py
@@ -38,7 +38,7 @@ def test_password_change(self):
 
         # save a new revision
         response = self.client.post(resolve_url("wiki:profile_update"), example_data)
-        self.assertContains(response, "Passwords don&#39;t match", status_code=200)
+        self.assertContains(response, "Passwords don", status_code=200)  # Django 2/3 output different escaped versions of single quote in don't
 
         # Now check that we don't succeed with unmatching passwords
         example_data = {