From 691f2c49d1724c0ddc7765c26eff977f1d881abe Mon Sep 17 00:00:00 2001 From: Sean Meyer Date: Thu, 6 Feb 2020 11:43:47 +0800 Subject: [PATCH] Updates to support django 3 with new dependancies --- .../migrations/0003_auto_20200206_0327.py | 28 +++++++++++++++++++ src/wiki/plugins/attachments/forms.py | 7 ----- tests/core/test_accounts.py | 2 +- 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 src/wiki/migrations/0003_auto_20200206_0327.py diff --git a/src/wiki/migrations/0003_auto_20200206_0327.py b/src/wiki/migrations/0003_auto_20200206_0327.py new file mode 100644 index 00000000..e4bf0311 --- /dev/null +++ b/src/wiki/migrations/0003_auto_20200206_0327.py @@ -0,0 +1,28 @@ +# Generated by Django 3.0.3 on 2020-02-06 02:27 + +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 index 7b124a5a..fcde37df 100644 --- 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): diff --git a/tests/core/test_accounts.py b/tests/core/test_accounts.py index 3d7ceaff..7058cfa3 100644 --- a/tests/core/test_accounts.py +++ b/tests/core/test_accounts.py @@ -38,7 +38,7 @@ class AccountUpdateTest( # save a new revision response = self.client.post(resolve_url("wiki:profile_update"), example_data) - self.assertContains(response, "Passwords don'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 = { -- 2.45.2