Repository: django-wiki/django-wiki

Issue:
Django 5 support
Pending other dependencies

* https://github.com/django-wiki/django-nyt/issues/126


Discussion:
waiting for django-nyt 1.4...
An update: I've been trying out the updated django-nyt rcs for a while now, and I think it's fine to release a stable version.
cool!
👍 


Resolving patch:
diff --git a/src/wiki/__about__.py b/src/wiki/__about__.py
--- a/src/wiki/__about__.py
+++ b/src/wiki/__about__.py
@@ -1 +1 @@
-__version__ = "0.10"
+__version__ = "0.11rc1"


Test patch:
diff --git a/tests/core/test_models.py b/tests/core/test_models.py
--- a/tests/core/test_models.py
+++ b/tests/core/test_models.py
@@ -129,9 +129,9 @@ def test_cache(self):
         )
         expected = """<h1 id="wiki-toc-header">header""" """.*</h1>"""
         # cached content does not exist yet. this will create it
-        self.assertRegexpMatches(a.get_cached_content(), expected)
+        self.assertRegex(a.get_cached_content(), expected)
         # actual cached content test
-        self.assertRegexpMatches(a.get_cached_content(), expected)
+        self.assertRegex(a.get_cached_content(), expected)
 
     def test_articlerevision_presave_signals(self):
         a = Article.objects.create()
diff --git a/tests/core/test_template_tags.py b/tests/core/test_template_tags.py
--- a/tests/core/test_template_tags.py
+++ b/tests/core/test_template_tags.py
@@ -211,14 +211,14 @@ def test_called_with_preview_content_and_article_have_current_revision(
         output = wiki_render({}, article, preview_content=content)
         self.assertCountEqual(self.keys, output)
         self.assertEqual(output["article"], article)
-        self.assertRegexpMatches(output["content"], expected)
+        self.assertRegex(output["content"], expected)
         self.assertIs(output["preview"], True)
         self.assertEqual(output["plugins"], {"spam": "eggs"})
         self.assertEqual(output["STATIC_URL"], django_settings.STATIC_URL)
         self.assertEqual(output["CACHE_TIMEOUT"], settings.CACHE_TIMEOUT)
 
         output = self.render({"article": article, "pc": content})
-        self.assertRegexpMatches(output, expected)
+        self.assertRegex(output, expected)
 
     def test_called_with_preview_content_and_article_dont_have_current_revision(
         self
diff --git a/tests/plugins/attachments/test_views.py b/tests/plugins/attachments/test_views.py
--- a/tests/plugins/attachments/test_views.py
+++ b/tests/plugins/attachments/test_views.py
@@ -159,12 +159,12 @@ def test_render(self):
             r'<span class="attachment"><a href=".*attachments/download/1/"'
             r' title="Click to download test\.txt">\s*test\.txt\s*</a>'
         )
-        self.assertRegexpMatches(output, expected)
+        self.assertRegex(output, expected)
 
     def test_render_missing(self):
         output = self.get_article("[attachment:2]")
         expected = r'<span class="attachment attachment-deleted">\s*Attachment with ID #2 is deleted.\s*</span>'
-        self.assertRegexpMatches(output, expected)
+        self.assertRegex(output, expected)
 
     def test_render_title(self):
         output = self.get_article('[attachment:1 title:"Test title"]')
@@ -172,7 +172,7 @@ def test_render_title(self):
             r'<span class="attachment"><a href=".*attachments/download/1/"'
             r' title="Click to download test\.txt">\s*Test title\s*</a>'
         )
-        self.assertRegexpMatches(output, expected)
+        self.assertRegex(output, expected)
 
     def test_render_title_size(self):
         output = self.get_article('[attachment:1 title:"Test title 2" size]')
@@ -180,4 +180,4 @@ def test_render_title_size(self):
             r'<span class="attachment"><a href=".*attachments/download/1/"'
             r' title="Click to download test\.txt">\s*Test title 2 \[25[^b]bytes\]\s*</a>'
         )
-        self.assertRegexpMatches(output, expected)
+        self.assertRegex(output, expected)
diff --git a/tests/plugins/globalhistory/test_globalhistory.py b/tests/plugins/globalhistory/test_globalhistory.py
--- a/tests/plugins/globalhistory/test_globalhistory.py
+++ b/tests/plugins/globalhistory/test_globalhistory.py
@@ -17,7 +17,7 @@ def test_history(self):
 
         response = self.client.get(url)
         expected = "(?s).*Root Article.*no log message.*"
-        self.assertRegexpMatches(response.rendered_content, expected)
+        self.assertRegex(response.rendered_content, expected)
 
         URLPath.create_urlpath(
             URLPath.root(),
@@ -30,7 +30,7 @@ def test_history(self):
         expected = (
             "(?s).*TestHistory1.*Comment 1.*" "Root Article.*no log message.*"
         )
-        self.assertRegexpMatches(response.rendered_content, expected)
+        self.assertRegex(response.rendered_content, expected)
 
         urlpath = URLPath.create_urlpath(
             URLPath.root(),
@@ -45,13 +45,13 @@ def test_history(self):
             "Root Article.*no log message.*"
         )
         response = self.client.get(url)
-        self.assertRegexpMatches(response.rendered_content, expected)
+        self.assertRegex(response.rendered_content, expected)
 
         response = self.client.get(url0)
-        self.assertRegexpMatches(response.rendered_content, expected)
+        self.assertRegex(response.rendered_content, expected)
 
         response = self.client.get(url1)
-        self.assertRegexpMatches(response.rendered_content, expected)
+        self.assertRegex(response.rendered_content, expected)
 
         response = self.client.post(
             reverse("wiki:edit", kwargs={"path": "testhistory2/"}),
@@ -72,10 +72,10 @@ def test_history(self):
             "Root Article.*no log message.*"
         )
         response = self.client.get(url)
-        self.assertRegexpMatches(response.rendered_content, expected)
+        self.assertRegex(response.rendered_content, expected)
 
         response = self.client.get(url0)
-        self.assertRegexpMatches(response.rendered_content, expected)
+        self.assertRegex(response.rendered_content, expected)
 
         expected = (
             "(?s).*TestHistory2Mod.*Testing Revision.*"
@@ -83,7 +83,7 @@ def test_history(self):
             "Root Article.*no log message.*"
         )
         response = self.client.get(url1)
-        self.assertRegexpMatches(response.rendered_content, expected)
+        self.assertRegex(response.rendered_content, expected)
 
     def test_translation(self):
         # Test that translation of "List of %s changes in the wiki." exists.