瀏覽代碼

Add changelog & release notes for #9294

LB Johnston 2 年之前
父節點
當前提交
e7f007c6c2
共有 2 個文件被更改,包括 19 次插入0 次删除
  1. 1 0
      CHANGELOG.txt
  2. 18 0
      docs/releases/4.1.md

+ 1 - 0
CHANGELOG.txt

@@ -52,6 +52,7 @@ Changelog
  * Add "What's New" dashboard banner and "Help" menu in sidebar (Sage Abdullah)
  * Implement new "minimap" component for the page editor (Thibaud Colas)
  * The `image_url` template tag, when using the serve view to redirect rather than serve directly, will now use temporary redirects with a cache header instead of permanent redirects (Jake Howard)
+ * Add new test assertions to `WagtailPageTestCase` - `assertPageIsRoutable`, `assertPageIsRenderable`, `assertPageIsEditable`, `assertPageIsPreviewable` (Andy Babic)
  * Fix: Prevent `PageQuerySet.not_public` from returning all pages when no page restrictions exist (Mehrdad Moradizadeh)
  * Fix: Ensure that duplicate block ids are unique when duplicating stream blocks in the page editor (Joshua Munn)
  * Fix: Revise colour usage so that privacy & locked indicators can be seen in Windows High Contrast mode (LB (Ben Johnston))

+ 18 - 0
docs/releases/4.1.md

@@ -95,6 +95,7 @@ There are multiple improvements to the documentation theme this release, here ar
  * Adjust breadcrumb text alignment and size in page listings & page editor (Steven Steinwand)
  * Improvements to getting started tutorial aimed at developers who are very new to Python and have no Django experience (Damilola Oladele)
  * The `image_url` template tag, when using the serve view to redirect rather than serve directly, will now use temporary redirects with a cache header instead of permanent redirects (Jake Howard)
+ * Add new test assertions to `WagtailPageTestCase` - `assertPageIsRoutable`, `assertPageIsRenderable`, `assertPageIsEditable`, `assertPageIsPreviewable` (Andy Babic)
 
 ### Bug fixes
 
@@ -135,6 +136,23 @@ There are multiple improvements to the documentation theme this release, here ar
 
 After upgrading, you will need to run `./manage.py rebuild_references_index` in order to populate the references table and ensure that usage counts for images, documents and snippets are displayed accurately.
 
+### Recommend `WagtailPageTestCase` in place of `WagtailPageTests`
+
+* `WagtailPageTestCase` is the base testing class and is now recommended over using `WagtailPageTestCase` [](testing_reference).
+* `WagtailPageTests` will continue to work and does log in the user on test `setUp` but may be deprecated in the future.
+
+```python
+# class MyPageTests(WagtailPageTests): # old
+class MyPageTests(WagtailPageTestCase): # new
+    def setUp(self):
+        # WagtailPageTestCase will not log in during setUp - so add if needed
+        super().setUp()
+        self.login()
+
+    def test_can_create_a_page(self):
+      # ...
+```
+
 ### Button styling class changes
 
 The `button-secondary` class is no longer compatible with either the `.serious` or `.no` classes, this partially worked previously but is no longer officially supported.