wagtail 6.2.2__py3-none-any.whl → 6.3rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wagtail/__init__.py +1 -1
- wagtail/actions/copy_for_translation.py +6 -0
- wagtail/actions/publish_revision.py +3 -3
- wagtail/admin/action_menu.py +5 -3
- wagtail/admin/forms/account.py +1 -1
- wagtail/admin/icons.py +2 -6
- wagtail/admin/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/cy/LC_MESSAGES/django.po +32 -0
- wagtail/admin/locale/dv/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/dv/LC_MESSAGES/django.po +28 -0
- wagtail/admin/locale/en/LC_MESSAGES/django.po +451 -485
- wagtail/admin/locale/en/LC_MESSAGES/djangojs.po +7 -7
- wagtail/admin/locale/sl/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/sl/LC_MESSAGES/django.po +150 -0
- wagtail/admin/locale/sl/LC_MESSAGES/djangojs.mo +0 -0
- wagtail/admin/locale/sl/LC_MESSAGES/djangojs.po +9 -2
- wagtail/admin/locale/ug/LC_MESSAGES/django.mo +0 -0
- wagtail/admin/locale/ug/LC_MESSAGES/django.po +3250 -196
- wagtail/admin/localization.py +8 -2
- wagtail/admin/panels/model_utils.py +1 -1
- wagtail/admin/site_summary.py +0 -2
- wagtail/admin/static/wagtailadmin/css/core.css +1 -1
- wagtail/admin/static/wagtailadmin/css/panels/draftail.css +1 -1
- wagtail/admin/static/wagtailadmin/images/email-header.jpg +0 -0
- wagtail/admin/static/wagtailadmin/js/bulk-actions.js +1 -1
- wagtail/admin/static/wagtailadmin/js/core.js +1 -1
- wagtail/admin/static/wagtailadmin/js/core.js.LICENSE.txt +12 -0
- wagtail/admin/static/wagtailadmin/js/draftail.js +1 -1
- wagtail/admin/static/wagtailadmin/js/sidebar.js +1 -1
- wagtail/admin/static/wagtailadmin/js/telepath/telepath.js +1 -1
- wagtail/admin/static/wagtailadmin/js/telepath/widgets.js +1 -1
- wagtail/admin/static/wagtailadmin/js/userbar.js +1 -1
- wagtail/admin/static/wagtailadmin/js/userbar.js.LICENSE.txt +1 -1
- wagtail/admin/static/wagtailadmin/js/vendor.js +1 -1
- wagtail/admin/static/wagtailadmin/js/wagtailadmin.js +1 -1
- wagtail/admin/static/wagtailadmin/js/workflow-action.js +1 -1
- wagtail/admin/staticfiles.py +6 -4
- wagtail/admin/templates/wagtailadmin/account/account.html +42 -59
- wagtail/admin/templates/wagtailadmin/admin_base.html +0 -28
- wagtail/admin/templates/wagtailadmin/bulk_actions/footer.html +1 -1
- wagtail/admin/templates/wagtailadmin/chooser/_search_results.html +7 -5
- wagtail/admin/templates/wagtailadmin/chooser/tables/page_navigate_to_children_cell.html +1 -1
- wagtail/admin/templates/wagtailadmin/generic/chooser/results.html +7 -5
- wagtail/admin/templates/wagtailadmin/generic/edit.html +0 -8
- wagtail/admin/templates/wagtailadmin/generic/form.html +60 -17
- wagtail/admin/templates/wagtailadmin/generic/index.html +17 -0
- wagtail/admin/templates/wagtailadmin/generic/index_results.html +9 -35
- wagtail/admin/templates/wagtailadmin/generic/inspect.html +2 -21
- wagtail/admin/templates/wagtailadmin/generic/listing.html +11 -17
- wagtail/admin/templates/wagtailadmin/generic/listing_results.html +19 -1
- wagtail/admin/templates/wagtailadmin/home/account_summary.html +26 -0
- wagtail/admin/templates/wagtailadmin/home/locked_pages.html +28 -18
- wagtail/admin/templates/wagtailadmin/home/recent_edits.html +28 -17
- wagtail/admin/templates/wagtailadmin/home/site_summary_pages.html +2 -2
- wagtail/admin/templates/wagtailadmin/home/upgrade_notification.html +35 -13
- wagtail/admin/templates/wagtailadmin/home/user_objects_in_workflow_moderation.html +28 -18
- wagtail/admin/templates/wagtailadmin/home/workflow_objects_to_moderate.html +43 -32
- wagtail/admin/templates/wagtailadmin/home.html +22 -5
- wagtail/admin/templates/wagtailadmin/pages/_editor_js.html +0 -1
- wagtail/admin/templates/wagtailadmin/pages/action_menu/menu.html +1 -11
- wagtail/admin/templates/wagtailadmin/pages/action_menu/menu_item.html +1 -6
- wagtail/admin/templates/wagtailadmin/pages/action_menu/page_locked.html +1 -1
- wagtail/admin/templates/wagtailadmin/pages/action_menu/publish.html +1 -1
- wagtail/admin/templates/wagtailadmin/pages/action_menu/save_draft.html +1 -1
- wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_delete.html +12 -6
- wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_move.html +12 -7
- wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_publish.html +17 -11
- wagtail/admin/templates/wagtailadmin/pages/bulk_actions/confirm_bulk_unpublish.html +15 -9
- wagtail/admin/templates/wagtailadmin/pages/confirm_delete.html +9 -9
- wagtail/admin/templates/wagtailadmin/pages/confirm_move.html +2 -2
- wagtail/admin/templates/wagtailadmin/pages/confirm_unpublish.html +4 -4
- wagtail/admin/templates/wagtailadmin/pages/create.html +15 -34
- wagtail/admin/templates/wagtailadmin/pages/edit.html +15 -30
- wagtail/admin/templates/wagtailadmin/pages/explorable_index.html +6 -0
- wagtail/admin/templates/wagtailadmin/pages/explorable_index_results.html +60 -0
- wagtail/admin/templates/wagtailadmin/pages/index.html +1 -36
- wagtail/admin/templates/wagtailadmin/pages/index_results.html +2 -50
- wagtail/admin/templates/wagtailadmin/pages/listing/_locked_indicator.html +1 -1
- wagtail/admin/templates/wagtailadmin/pages/listing/_ordering_cell.html +1 -1
- wagtail/admin/templates/wagtailadmin/pages/listing/_page_header_buttons.html +1 -1
- wagtail/admin/templates/wagtailadmin/pages/listing/_page_title_column_header.html +3 -3
- wagtail/admin/templates/wagtailadmin/pages/listing/_pagination.html +1 -1
- wagtail/admin/templates/wagtailadmin/pages/listing.html +24 -0
- wagtail/admin/templates/wagtailadmin/pages/search.html +1 -20
- wagtail/admin/templates/wagtailadmin/pages/search_results.html +27 -25
- wagtail/admin/templates/wagtailadmin/permissions/includes/collection_member_permissions_formset.html +0 -1
- wagtail/admin/templates/wagtailadmin/reports/listing/_list_page_report.html +2 -2
- wagtail/admin/templates/wagtailadmin/reports/listing/_list_page_types_usage.html +6 -6
- wagtail/admin/templates/wagtailadmin/reports/workflow_tasks_results.html +1 -1
- wagtail/admin/templates/wagtailadmin/shared/action_menu/menu.html +14 -0
- wagtail/admin/templates/wagtailadmin/shared/action_menu/menu_item.html +6 -0
- wagtail/admin/templates/wagtailadmin/shared/avatar.html +13 -3
- wagtail/admin/templates/wagtailadmin/shared/header.html +0 -5
- wagtail/admin/templates/wagtailadmin/shared/headers/slim_header.html +1 -1
- wagtail/admin/templates/wagtailadmin/shared/page_status_tag_new.html +4 -1
- wagtail/admin/templates/wagtailadmin/shared/pagination_nav.html +1 -1
- wagtail/admin/templates/wagtailadmin/shared/side_panel_toggle.html +1 -1
- wagtail/admin/templates/wagtailadmin/shared/side_panels/includes/status/locale.html +1 -1
- wagtail/admin/templates/wagtailadmin/shared/side_panels/includes/status/usage.html +2 -2
- wagtail/admin/templates/wagtailadmin/shared/side_panels/preview.html +94 -52
- wagtail/admin/templates/wagtailadmin/{pages/_unsaved_changes_warning.html → shared/unsaved_changes_warning.html} +4 -4
- wagtail/admin/templates/wagtailadmin/shared/usage_summary.html +2 -2
- wagtail/admin/templates/wagtailadmin/shared/workflow_history/detail.html +1 -7
- wagtail/admin/templates/wagtailadmin/shared/workflow_history/listing.html +1 -0
- wagtail/admin/templates/wagtailadmin/shared/workflow_history/{list.html → listing_results.html} +33 -35
- wagtail/admin/templates/wagtailadmin/tables/references_cell.html +1 -1
- wagtail/admin/templates/wagtailadmin/workflows/create.html +11 -36
- wagtail/admin/templates/wagtailadmin/workflows/create_task.html +0 -38
- wagtail/admin/templates/wagtailadmin/workflows/edit.html +44 -74
- wagtail/admin/templates/wagtailadmin/workflows/edit_task.html +27 -66
- wagtail/admin/templates/wagtailadmin/workflows/includes/task_usage_cell.html +4 -2
- wagtail/admin/templates/wagtailadmin/workflows/includes/workflow_tasks_cell.html +4 -4
- wagtail/admin/templates/wagtailadmin/workflows/includes/workflow_used_by_cell.html +15 -11
- wagtail/admin/templates/wagtailadmin/workflows/task_chooser/includes/results.html +7 -5
- wagtail/admin/templatetags/wagtailadmin_tags.py +51 -22
- wagtail/admin/tests/pages/test_content_type_use_view.py +82 -2
- wagtail/admin/tests/pages/test_edit_page.py +70 -0
- wagtail/admin/tests/pages/test_explorer_view.py +65 -4
- wagtail/admin/tests/pages/test_page_search.py +8 -7
- wagtail/admin/tests/pages/test_page_usage.py +3 -1
- wagtail/admin/tests/pages/test_preview.py +208 -63
- wagtail/admin/tests/pages/test_reorder_page.py +91 -1
- wagtail/admin/tests/pages/test_view_draft.py +32 -1
- wagtail/admin/tests/pages/test_workflow_history.py +288 -7
- wagtail/admin/tests/test_account_management.py +23 -3
- wagtail/admin/tests/test_audit_log.py +24 -2
- wagtail/admin/tests/test_collections_views.py +17 -5
- wagtail/admin/tests/test_dashboard.py +1 -1
- wagtail/admin/tests/test_edit_handlers.py +3 -2
- wagtail/admin/tests/test_icon_sprite.py +4 -0
- wagtail/admin/tests/test_privacy.py +5 -19
- wagtail/admin/tests/test_reports_views.py +1 -1
- wagtail/admin/tests/test_site_summary.py +3 -3
- wagtail/admin/tests/test_templatetags.py +27 -3
- wagtail/admin/tests/test_upgrade_notification.py +71 -18
- wagtail/admin/tests/test_views.py +2 -2
- wagtail/admin/tests/test_views_generic.py +13 -0
- wagtail/admin/tests/test_widgets.py +3 -3
- wagtail/admin/tests/test_workflows.py +172 -27
- wagtail/admin/tests/tests.py +1 -1
- wagtail/admin/tests/viewsets/test_model_viewset.py +55 -3
- wagtail/admin/ui/side_panels.py +19 -0
- wagtail/admin/ui/sidebar.py +4 -3
- wagtail/admin/ui/tables/__init__.py +14 -1
- wagtail/admin/ui/tables/pages.py +6 -1
- wagtail/admin/urls/pages.py +10 -1
- wagtail/admin/urls/workflows.py +6 -1
- wagtail/admin/views/account.py +5 -1
- wagtail/admin/views/collections.py +0 -2
- wagtail/admin/views/generic/base.py +118 -1
- wagtail/admin/views/generic/history.py +158 -26
- wagtail/admin/views/generic/models.py +113 -99
- wagtail/admin/views/home.py +24 -9
- wagtail/admin/views/page_privacy.py +54 -30
- wagtail/admin/views/pages/history.py +11 -4
- wagtail/admin/views/pages/listing.py +76 -89
- wagtail/admin/views/pages/preview.py +1 -1
- wagtail/admin/views/pages/search.py +27 -71
- wagtail/admin/views/pages/usage.py +63 -24
- wagtail/admin/views/pages/utils.py +4 -3
- wagtail/admin/views/reports/base.py +0 -6
- wagtail/admin/views/workflows.py +67 -25
- wagtail/admin/viewsets/model.py +4 -3
- wagtail/admin/widgets/chooser.py +2 -1
- wagtail/api/v2/tests/test_pages.py +15 -2
- wagtail/blocks/field_block.py +15 -3
- wagtail/blocks/static_block.py +3 -0
- wagtail/contrib/forms/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/forms/locale/cy/LC_MESSAGES/django.po +29 -1
- wagtail/contrib/forms/locale/en/LC_MESSAGES/django.po +15 -11
- wagtail/contrib/forms/templates/wagtailforms/confirm_delete.html +1 -0
- wagtail/contrib/forms/templates/wagtailforms/index.html +1 -1
- wagtail/contrib/forms/templates/wagtailforms/index_results.html +1 -1
- wagtail/contrib/forms/templates/wagtailforms/list_submissions.html +2 -1
- wagtail/contrib/forms/templates/wagtailforms/panels/form_responses_panel.html +2 -2
- wagtail/contrib/forms/tests/test_views.py +234 -35
- wagtail/contrib/forms/utils.py +8 -14
- wagtail/contrib/forms/views.py +72 -27
- wagtail/contrib/frontend_cache/backends/azure.py +1 -1
- wagtail/contrib/frontend_cache/backends/cloudfront.py +2 -2
- wagtail/contrib/frontend_cache/backends/dummy.py +11 -0
- wagtail/contrib/frontend_cache/tests.py +31 -37
- wagtail/contrib/frontend_cache/utils.py +12 -5
- wagtail/contrib/redirects/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/redirects/locale/cy/LC_MESSAGES/django.po +16 -1
- wagtail/contrib/redirects/locale/en/LC_MESSAGES/django.po +20 -24
- wagtail/contrib/redirects/models.py +16 -1
- wagtail/contrib/redirects/signal_handlers.py +18 -3
- wagtail/contrib/redirects/templates/wagtailredirects/add.html +5 -16
- wagtail/contrib/redirects/templates/wagtailredirects/import_summary.html +1 -1
- wagtail/contrib/redirects/tests/test_redirects.py +49 -6
- wagtail/contrib/redirects/tests/test_signal_handlers.py +42 -1
- wagtail/contrib/redirects/views.py +27 -3
- wagtail/contrib/search_promotions/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/search_promotions/locale/cy/LC_MESSAGES/django.po +60 -1
- wagtail/contrib/search_promotions/locale/en/LC_MESSAGES/django.po +12 -18
- wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/add.html +5 -8
- wagtail/contrib/search_promotions/templates/wagtailsearchpromotions/edit.html +15 -10
- wagtail/contrib/search_promotions/tests.py +13 -2
- wagtail/contrib/search_promotions/views.py +15 -3
- wagtail/contrib/settings/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/settings/locale/cy/LC_MESSAGES/django.po +6 -1
- wagtail/contrib/settings/locale/en/LC_MESSAGES/django.po +2 -10
- wagtail/contrib/settings/templates/wagtailsettings/edit.html +12 -45
- wagtail/contrib/simple_translation/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/simple_translation/locale/cy/LC_MESSAGES/django.po +13 -1
- wagtail/contrib/simple_translation/locale/dv/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/simple_translation/locale/dv/LC_MESSAGES/django.po +3 -0
- wagtail/contrib/simple_translation/locale/en/LC_MESSAGES/django.po +4 -4
- wagtail/contrib/simple_translation/locale/sl/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/simple_translation/locale/sl/LC_MESSAGES/django.po +5 -2
- wagtail/contrib/simple_translation/tests/test_views.py +51 -0
- wagtail/contrib/simple_translation/wagtail_hooks.py +16 -11
- wagtail/contrib/styleguide/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/styleguide/locale/cy/LC_MESSAGES/django.po +5 -1
- wagtail/contrib/styleguide/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/table_block/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/table_block/locale/cy/LC_MESSAGES/django.po +27 -1
- wagtail/contrib/table_block/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/contrib/typed_table_block/blocks.py +25 -0
- wagtail/contrib/typed_table_block/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/contrib/typed_table_block/locale/cy/LC_MESSAGES/django.po +12 -1
- wagtail/contrib/typed_table_block/locale/en/LC_MESSAGES/django.po +10 -10
- wagtail/contrib/typed_table_block/tests.py +24 -1
- wagtail/coreutils.py +5 -11
- wagtail/documents/admin_urls.py +2 -2
- wagtail/documents/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/documents/locale/cy/LC_MESSAGES/django.po +10 -0
- wagtail/documents/locale/en/LC_MESSAGES/django.po +61 -76
- wagtail/documents/migrations/0014_alter_document_file_size.py +18 -0
- wagtail/documents/models.py +1 -1
- wagtail/documents/rich_text/__init__.py +1 -3
- wagtail/documents/static/wagtaildocs/js/add-multiple.js +1 -1
- wagtail/documents/templates/wagtaildocs/bulk_actions/confirm_bulk_add_tags.html +5 -1
- wagtail/documents/templates/wagtaildocs/bulk_actions/confirm_bulk_add_to_collection.html +5 -1
- wagtail/documents/templates/wagtaildocs/bulk_actions/confirm_bulk_delete.html +11 -5
- wagtail/documents/templates/wagtaildocs/documents/add.html +13 -41
- wagtail/documents/templates/wagtaildocs/documents/edit.html +28 -56
- wagtail/documents/templates/wagtaildocs/documents/index.html +1 -4
- wagtail/documents/templates/wagtaildocs/homepage/site_summary_documents.html +2 -2
- wagtail/documents/templates/wagtaildocs/multiple/add.html +36 -41
- wagtail/documents/tests/test_admin_views.py +64 -6
- wagtail/documents/tests/test_site_summary.py +3 -3
- wagtail/documents/views/documents.py +103 -113
- wagtail/documents/views/multiple.py +19 -1
- wagtail/embeds/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/embeds/oembed_providers.py +9 -19
- wagtail/fields.py +43 -27
- wagtail/images/admin_urls.py +2 -2
- wagtail/images/blocks.py +230 -2
- wagtail/images/fields.py +17 -29
- wagtail/images/image_operations.py +1 -1
- wagtail/images/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/images/locale/cy/LC_MESSAGES/django.po +128 -1
- wagtail/images/locale/en/LC_MESSAGES/django.po +119 -129
- wagtail/images/migrations/0025_alter_image_file_alter_rendition_file.py +36 -43
- wagtail/images/migrations/0027_image_description.py +20 -0
- wagtail/images/models.py +120 -45
- wagtail/images/rich_text/__init__.py +1 -3
- wagtail/images/static/wagtailimages/js/add-multiple.js +1 -1
- wagtail/images/static/wagtailimages/js/image-block.js +1 -0
- wagtail/images/templates/wagtailimages/bulk_actions/confirm_bulk_add_tags.html +5 -1
- wagtail/images/templates/wagtailimages/bulk_actions/confirm_bulk_add_to_collection.html +5 -1
- wagtail/images/templates/wagtailimages/bulk_actions/confirm_bulk_delete.html +11 -5
- wagtail/images/templates/wagtailimages/chooser/results.html +2 -2
- wagtail/images/templates/wagtailimages/homepage/site_summary_images.html +2 -2
- wagtail/images/templates/wagtailimages/images/_file_field.html +2 -2
- wagtail/images/templates/wagtailimages/images/add.html +13 -31
- wagtail/images/templates/wagtailimages/images/edit.html +53 -82
- wagtail/images/templates/wagtailimages/images/index.html +1 -4
- wagtail/images/templates/wagtailimages/images/url_generator.html +1 -1
- wagtail/images/templates/wagtailimages/multiple/add.html +40 -47
- wagtail/images/templates/wagtailimages/widgets/image.html +5 -0
- wagtail/images/templates/wagtailimages/widgets/image_chooser.html +1 -1
- wagtail/images/tests/test_admin_views.py +70 -10
- wagtail/images/tests/test_blocks.py +367 -1
- wagtail/images/tests/test_image_operations.py +23 -0
- wagtail/images/tests/test_models.py +20 -0
- wagtail/images/tests/test_signal_handlers.py +99 -95
- wagtail/images/tests/test_site_summary.py +3 -3
- wagtail/images/tests/test_templatetags.py +11 -7
- wagtail/images/tests/tests.py +4 -0
- wagtail/images/views/images.py +103 -104
- wagtail/images/views/multiple.py +17 -1
- wagtail/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/locale/cy/LC_MESSAGES/django.po +3 -0
- wagtail/locale/en/LC_MESSAGES/django.po +137 -125
- wagtail/locale/sl/LC_MESSAGES/django.mo +0 -0
- wagtail/locale/sl/LC_MESSAGES/django.po +3 -0
- wagtail/locales/locale/en/LC_MESSAGES/django.po +8 -8
- wagtail/locales/views.py +4 -1
- wagtail/migrations/0089_log_entry_data_json_null_to_object.py +1 -7
- wagtail/models/__init__.py +122 -14
- wagtail/models/audit_log.py +1 -3
- wagtail/models/i18n.py +1 -2
- wagtail/project_template/Dockerfile +3 -3
- wagtail/project_template/requirements.txt +2 -2
- wagtail/query.py +17 -4
- wagtail/rich_text/__init__.py +2 -3
- wagtail/rich_text/pages.py +2 -4
- wagtail/rich_text/rewriters.py +2 -2
- wagtail/search/backends/database/mysql/query.py +3 -3
- wagtail/search/backends/database/sqlite/query.py +6 -6
- wagtail/search/locale/en/LC_MESSAGES/django.po +1 -1
- wagtail/sites/locale/en/LC_MESSAGES/django.po +6 -6
- wagtail/sites/views.py +0 -1
- wagtail/snippets/action_menu.py +14 -4
- wagtail/snippets/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/snippets/locale/cy/LC_MESSAGES/django.po +73 -1
- wagtail/snippets/locale/en/LC_MESSAGES/django.po +27 -33
- wagtail/snippets/static/wagtailsnippets/js/snippet-chooser-telepath.js +1 -1
- wagtail/snippets/static/wagtailsnippets/js/snippet-chooser.js +1 -1
- wagtail/snippets/templates/wagtailsnippets/bulk_actions/confirm_bulk_delete.html +5 -3
- wagtail/snippets/templates/wagtailsnippets/snippets/action_menu/locked.html +1 -1
- wagtail/snippets/templates/wagtailsnippets/snippets/action_menu/menu.html +1 -11
- wagtail/snippets/templates/wagtailsnippets/snippets/action_menu/menu_item.html +1 -6
- wagtail/snippets/templates/wagtailsnippets/snippets/action_menu/publish.html +1 -1
- wagtail/snippets/templates/wagtailsnippets/snippets/action_menu/save.html +1 -1
- wagtail/snippets/templates/wagtailsnippets/snippets/create.html +1 -18
- wagtail/snippets/templates/wagtailsnippets/snippets/edit.html +1 -14
- wagtail/snippets/templates/wagtailsnippets/snippets/index.html +2 -5
- wagtail/snippets/tests/test_preview.py +193 -61
- wagtail/snippets/tests/test_snippets.py +247 -38
- wagtail/snippets/tests/test_usage.py +5 -0
- wagtail/snippets/tests/test_viewset.py +25 -9
- wagtail/snippets/tests/test_workflows.py +232 -19
- wagtail/snippets/views/snippets.py +1 -10
- wagtail/test/numberformat.py +104 -0
- wagtail/test/settings.py +10 -0
- wagtail/test/settings_ui.py +2 -0
- wagtail/test/testapp/migrations/0010_alter_customimage_file_and_more.py +71 -78
- wagtail/test/testapp/migrations/0040_nocreatablesubpagetypespage_nosubpagetypespage.py +54 -0
- wagtail/test/testapp/migrations/0041_alter_jsonstreammodel_options.py +17 -0
- wagtail/test/testapp/migrations/0042_alter_customdocument_file_size_and_more.py +28 -0
- wagtail/test/testapp/migrations/0043_customimage_description.py +41 -0
- wagtail/test/testapp/migrations/0044_custompreviewsizesmodel_custompreviewsizespage.py +52 -0
- wagtail/test/testapp/migrations/0045_alter_streampage_body.py +52 -0
- wagtail/test/testapp/models.py +62 -4
- wagtail/test/testapp/rich_text.py +2 -2
- wagtail/test/testapp/templates/tests/form_page_landing.html +2 -1
- wagtail/test/testapp/urls.py +5 -0
- wagtail/test/testapp/views.py +5 -0
- wagtail/test/utils/page_tests.py +5 -5
- wagtail/test/utils/template_tests.py +2 -2
- wagtail/tests/test_blocks.py +15 -0
- wagtail/tests/test_page_permissions.py +109 -0
- wagtail/tests/test_revision_model.py +27 -0
- wagtail/tests/test_signals.py +21 -2
- wagtail/tests/test_tests.py +30 -0
- wagtail/users/locale/cy/LC_MESSAGES/django.mo +0 -0
- wagtail/users/locale/cy/LC_MESSAGES/django.po +118 -1
- wagtail/users/locale/dv/LC_MESSAGES/django.mo +0 -0
- wagtail/users/locale/dv/LC_MESSAGES/django.po +3 -0
- wagtail/users/locale/en/LC_MESSAGES/django.po +89 -113
- wagtail/users/locale/sl/LC_MESSAGES/django.mo +0 -0
- wagtail/users/locale/sl/LC_MESSAGES/django.po +3 -0
- wagtail/users/migrations/0014_userprofile_contrast.py +23 -0
- wagtail/users/models.py +11 -0
- wagtail/users/templates/wagtailusers/bulk_actions/confirm_bulk_assign_role.html +5 -1
- wagtail/users/templates/wagtailusers/bulk_actions/confirm_bulk_delete.html +5 -1
- wagtail/users/templates/wagtailusers/bulk_actions/confirm_bulk_set_active_state.html +5 -1
- wagtail/users/templates/wagtailusers/groups/create.html +19 -17
- wagtail/users/templates/wagtailusers/groups/edit.html +2 -40
- wagtail/users/templates/wagtailusers/groups/includes/formatted_permissions.html +1 -62
- wagtail/users/templates/wagtailusers/groups/includes/page_permissions_formset.html +0 -1
- wagtail/users/templates/wagtailusers/users/create.html +46 -50
- wagtail/users/templates/wagtailusers/users/edit.html +45 -62
- wagtail/users/templates/wagtailusers/users/index.html +1 -4
- wagtail/users/templatetags/wagtailusers_tags.py +1 -5
- wagtail/users/tests/test_admin_views.py +85 -66
- wagtail/users/views/groups.py +4 -1
- wagtail/users/views/users.py +2 -0
- {wagtail-6.2.2.dist-info → wagtail-6.3rc1.dist-info}/METADATA +6 -6
- {wagtail-6.2.2.dist-info → wagtail-6.3rc1.dist-info}/RECORD +378 -367
- wagtail/admin/static/wagtailadmin/js/preview-panel.js +0 -2
- wagtail/admin/static/wagtailadmin/js/preview-panel.js.LICENSE.txt +0 -11
- wagtail/admin/templates/wagtailadmin/generic/history_results.html +0 -1
- wagtail/admin/templates/wagtailadmin/page_privacy/ancestor_privacy.html +0 -3
- wagtail/admin/templates/wagtailadmin/pages/usage_results.html +0 -6
- wagtail/admin/templates/wagtailadmin/shared/workflow_history/index.html +0 -17
- wagtail/admin/templates/wagtailadmin/shared/workflow_history/results.html +0 -17
- wagtail/admin/templates/wagtailadmin/workflows/usage.html +0 -44
- {wagtail-6.2.2.dist-info → wagtail-6.3rc1.dist-info}/LICENSE +0 -0
- {wagtail-6.2.2.dist-info → wagtail-6.3rc1.dist-info}/WHEEL +0 -0
- {wagtail-6.2.2.dist-info → wagtail-6.3rc1.dist-info}/entry_points.txt +0 -0
- {wagtail-6.2.2.dist-info → wagtail-6.3rc1.dist-info}/top_level.txt +0 -0
|
@@ -11,7 +11,8 @@ from django.test.utils import override_settings
|
|
|
11
11
|
from django.utils import timezone
|
|
12
12
|
from freezegun import freeze_time
|
|
13
13
|
|
|
14
|
-
from wagtail.admin.
|
|
14
|
+
from wagtail.admin.localization import get_js_translation_strings
|
|
15
|
+
from wagtail.admin.staticfiles import VERSION_HASH, versioned_static
|
|
15
16
|
from wagtail.admin.templatetags.wagtailadmin_tags import (
|
|
16
17
|
avatar_url,
|
|
17
18
|
i18n_enabled,
|
|
@@ -27,6 +28,7 @@ from wagtail.models import Locale, Page
|
|
|
27
28
|
from wagtail.test.utils import WagtailTestUtils
|
|
28
29
|
from wagtail.test.utils.template_tests import AdminTemplateTestUtils
|
|
29
30
|
from wagtail.users.models import UserProfile
|
|
31
|
+
from wagtail.utils.deprecation import RemovedInWagtail70Warning
|
|
30
32
|
|
|
31
33
|
|
|
32
34
|
class TestAvatarTemplateTag(WagtailTestUtils, TestCase):
|
|
@@ -99,9 +101,12 @@ class TestNotificationStaticTemplateTag(SimpleTestCase):
|
|
|
99
101
|
|
|
100
102
|
|
|
101
103
|
class TestVersionedStatic(SimpleTestCase):
|
|
104
|
+
def test_version_hash(self):
|
|
105
|
+
self.assertEqual(len(VERSION_HASH), 8)
|
|
106
|
+
|
|
102
107
|
def test_versioned_static(self):
|
|
103
108
|
result = versioned_static("wagtailadmin/js/core.js")
|
|
104
|
-
self.assertRegex(result, r"^/static/wagtailadmin/js/core.js\?v=(\w
|
|
109
|
+
self.assertRegex(result, r"^/static/wagtailadmin/js/core.js\?v=(\w{8})$")
|
|
105
110
|
|
|
106
111
|
@mock.patch("wagtail.admin.staticfiles.static")
|
|
107
112
|
def test_versioned_static_version_string(self, mock_static):
|
|
@@ -375,7 +380,12 @@ class TestInternationalisationTags(TestCase):
|
|
|
375
380
|
self.assertTrue(i18n_enabled())
|
|
376
381
|
|
|
377
382
|
def test_locales(self):
|
|
378
|
-
|
|
383
|
+
with self.assertWarnsMessage(
|
|
384
|
+
RemovedInWagtail70Warning,
|
|
385
|
+
"The `locales` template tag will be removed in a future release.",
|
|
386
|
+
):
|
|
387
|
+
locales_output = locales_tag()
|
|
388
|
+
|
|
379
389
|
self.assertIsInstance(locales_output, str)
|
|
380
390
|
self.assertEqual(
|
|
381
391
|
json.loads(locales_output),
|
|
@@ -398,6 +408,20 @@ class TestInternationalisationTags(TestCase):
|
|
|
398
408
|
with self.assertNumQueries(0):
|
|
399
409
|
self.assertIsNone(locale_label_from_id(self.locale_ids[-1] + 100), None)
|
|
400
410
|
|
|
411
|
+
def test_js_translation_strings(self):
|
|
412
|
+
template = """
|
|
413
|
+
{% load wagtailadmin_tags %}
|
|
414
|
+
{% js_translation_strings %}
|
|
415
|
+
"""
|
|
416
|
+
|
|
417
|
+
expected = json.dumps(get_js_translation_strings())
|
|
418
|
+
|
|
419
|
+
with self.assertWarnsMessage(
|
|
420
|
+
RemovedInWagtail70Warning,
|
|
421
|
+
"The `js_translation_strings` template tag will be removed in a future release.",
|
|
422
|
+
):
|
|
423
|
+
self.assertHTMLEqual(expected, Template(template).render(Context()))
|
|
424
|
+
|
|
401
425
|
|
|
402
426
|
class ComponentTest(SimpleTestCase):
|
|
403
427
|
def test_render_block_component(self):
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
from django.test import RequestFactory, TestCase, override_settings
|
|
2
2
|
|
|
3
|
+
from wagtail import __version__
|
|
3
4
|
from wagtail.admin.views.home import UpgradeNotificationPanel
|
|
4
5
|
from wagtail.test.utils import WagtailTestUtils
|
|
6
|
+
from wagtail.users.models import UserProfile
|
|
5
7
|
|
|
6
8
|
|
|
7
9
|
class TestUpgradeNotificationPanel(WagtailTestUtils, TestCase):
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
ATTR_UPGRADE_CHECK_LTS = "data-w-upgrade-lts-only-value"
|
|
11
|
+
ATTR_CURRENT_VERSION = "data-w-upgrade-current-version-value"
|
|
12
|
+
ATTR_DISMISSIBLE_ID = "data-w-dismissible-id-value"
|
|
13
|
+
ATTR_LAST_DISMISSED_VALUE = "data-w-dismissible-value-param"
|
|
14
|
+
DISMISSIBLE_ID = "last_upgrade_check"
|
|
10
15
|
|
|
11
16
|
@classmethod
|
|
12
17
|
def setUpTestData(cls):
|
|
@@ -59,9 +64,21 @@ class TestUpgradeNotificationPanel(WagtailTestUtils, TestCase):
|
|
|
59
64
|
parent_context = {"request": self.request}
|
|
60
65
|
|
|
61
66
|
result = self.panel.render_html(parent_context)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
self.
|
|
67
|
+
soup = self.get_soup(result)
|
|
68
|
+
controller = soup.select_one("[data-controller]")
|
|
69
|
+
self.assertIsNotNone(controller)
|
|
70
|
+
self.assertEqual(
|
|
71
|
+
set(controller["data-controller"].split()),
|
|
72
|
+
{"w-upgrade", "w-dismissible"},
|
|
73
|
+
)
|
|
74
|
+
self.assertFalse(controller.get(self.ATTR_UPGRADE_CHECK_LTS))
|
|
75
|
+
self.assertEqual(
|
|
76
|
+
controller.get(self.ATTR_DISMISSIBLE_ID),
|
|
77
|
+
self.DISMISSIBLE_ID,
|
|
78
|
+
)
|
|
79
|
+
toggle = soup.select_one("[data-action='w-dismissible#toggle']")
|
|
80
|
+
self.assertIsNotNone(toggle)
|
|
81
|
+
self.assertIsNone(toggle.get(self.ATTR_LAST_DISMISSED_VALUE))
|
|
65
82
|
|
|
66
83
|
@override_settings(WAGTAIL_ENABLE_UPDATE_CHECK=False)
|
|
67
84
|
def test_render_html_setting_false(self):
|
|
@@ -72,22 +89,58 @@ class TestUpgradeNotificationPanel(WagtailTestUtils, TestCase):
|
|
|
72
89
|
|
|
73
90
|
self.assertEqual(result, "")
|
|
74
91
|
|
|
75
|
-
|
|
76
|
-
def test_render_html_setting_LTS(self):
|
|
92
|
+
def test_render_html_setting_lts(self):
|
|
77
93
|
self.request.user = self.superuser
|
|
78
94
|
parent_context = {"request": self.request}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
95
|
+
setting_values = ["lts", "LTS"]
|
|
96
|
+
for value in setting_values:
|
|
97
|
+
with self.subTest(setting=value):
|
|
98
|
+
with override_settings(WAGTAIL_ENABLE_UPDATE_CHECK=value):
|
|
99
|
+
result = self.panel.render_html(parent_context)
|
|
100
|
+
|
|
101
|
+
soup = self.get_soup(result)
|
|
102
|
+
controller = soup.select_one("[data-controller]")
|
|
103
|
+
self.assertIsNotNone(controller)
|
|
104
|
+
self.assertEqual(
|
|
105
|
+
set(controller["data-controller"].split()),
|
|
106
|
+
{"w-upgrade", "w-dismissible"},
|
|
107
|
+
)
|
|
108
|
+
self.assertEqual(
|
|
109
|
+
controller.get(self.ATTR_UPGRADE_CHECK_LTS),
|
|
110
|
+
"true",
|
|
111
|
+
)
|
|
112
|
+
self.assertEqual(
|
|
113
|
+
controller.get(self.ATTR_DISMISSIBLE_ID),
|
|
114
|
+
self.DISMISSIBLE_ID,
|
|
115
|
+
)
|
|
116
|
+
toggle = soup.select_one("[data-action='w-dismissible#toggle']")
|
|
117
|
+
self.assertIsNotNone(toggle)
|
|
118
|
+
self.assertIsNone(toggle.get(self.ATTR_LAST_DISMISSED_VALUE))
|
|
119
|
+
|
|
120
|
+
def test_render_html_dismissed_version(self):
|
|
121
|
+
profile = UserProfile.get_for_user(self.superuser)
|
|
122
|
+
profile.dismissibles.update({self.DISMISSIBLE_ID: "6.2.2"})
|
|
123
|
+
profile.save()
|
|
87
124
|
self.request.user = self.superuser
|
|
88
125
|
parent_context = {"request": self.request}
|
|
89
126
|
|
|
90
127
|
result = self.panel.render_html(parent_context)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
128
|
+
soup = self.get_soup(result)
|
|
129
|
+
|
|
130
|
+
controller = soup.select_one("[data-controller='w-upgrade w-dismissible']")
|
|
131
|
+
self.assertIsNotNone(controller)
|
|
132
|
+
|
|
133
|
+
self.assertEqual(
|
|
134
|
+
controller.get(self.ATTR_DISMISSIBLE_ID),
|
|
135
|
+
self.DISMISSIBLE_ID,
|
|
136
|
+
)
|
|
137
|
+
self.assertEqual(
|
|
138
|
+
controller.get(self.ATTR_CURRENT_VERSION),
|
|
139
|
+
__version__,
|
|
140
|
+
)
|
|
141
|
+
toggle = soup.select_one("[data-action='w-dismissible#toggle']")
|
|
142
|
+
self.assertIsNotNone(toggle)
|
|
143
|
+
self.assertEqual(
|
|
144
|
+
toggle.get(self.ATTR_LAST_DISMISSED_VALUE),
|
|
145
|
+
"6.2.2",
|
|
146
|
+
)
|
|
@@ -81,7 +81,7 @@ class TestLoginView(WagtailTestUtils, TestCase):
|
|
|
81
81
|
response = self.client.get(reverse("wagtailadmin_login"))
|
|
82
82
|
self.assertContains(
|
|
83
83
|
response,
|
|
84
|
-
'<html lang="de" dir="ltr" class="w-theme-system w-density-default">',
|
|
84
|
+
'<html lang="de" dir="ltr" class="w-theme-system w-density-default w-contrast-system">',
|
|
85
85
|
)
|
|
86
86
|
|
|
87
87
|
@override_settings(LANGUAGE_CODE="he")
|
|
@@ -89,7 +89,7 @@ class TestLoginView(WagtailTestUtils, TestCase):
|
|
|
89
89
|
response = self.client.get(reverse("wagtailadmin_login"))
|
|
90
90
|
self.assertContains(
|
|
91
91
|
response,
|
|
92
|
-
'<html lang="he" dir="rtl" class="w-theme-system w-density-default">',
|
|
92
|
+
'<html lang="he" dir="rtl" class="w-theme-system w-density-default w-contrast-system">',
|
|
93
93
|
)
|
|
94
94
|
|
|
95
95
|
@override_settings(
|
|
@@ -24,6 +24,19 @@ class TestGenericIndexView(WagtailTestUtils, TestCase):
|
|
|
24
24
|
self.assertEqual(h1.text.strip(), "Model with string type primary keys")
|
|
25
25
|
|
|
26
26
|
|
|
27
|
+
class TestGenericIndexViewWithoutModel(WagtailTestUtils, TestCase):
|
|
28
|
+
fixtures = ["test.json"]
|
|
29
|
+
|
|
30
|
+
def get(self, params={}):
|
|
31
|
+
return self.client.get(reverse("testapp_generic_index_without_model"), params)
|
|
32
|
+
|
|
33
|
+
def test_non_integer_primary_key(self):
|
|
34
|
+
response = self.get()
|
|
35
|
+
self.assertEqual(response.status_code, 200)
|
|
36
|
+
response_object_count = response.context_data["object_list"].count()
|
|
37
|
+
self.assertEqual(response_object_count, 3)
|
|
38
|
+
|
|
39
|
+
|
|
27
40
|
class TestGenericEditView(WagtailTestUtils, TestCase):
|
|
28
41
|
fixtures = ["test.json"]
|
|
29
42
|
|
|
@@ -119,7 +119,7 @@ class TestAdminPageChooserWidget(TestCase):
|
|
|
119
119
|
)
|
|
120
120
|
|
|
121
121
|
html = widget.render("test", self.child_page, {"id": "test-id"})
|
|
122
|
-
self.assertIn("Choose a page (Simple
|
|
122
|
+
self.assertIn("Choose a page (Simple page)", html)
|
|
123
123
|
|
|
124
124
|
def test_render_with_target_model_as_single_instance(self):
|
|
125
125
|
widget = widgets.AdminPageChooser(target_models=SimplePage)
|
|
@@ -131,7 +131,7 @@ class TestAdminPageChooserWidget(TestCase):
|
|
|
131
131
|
)
|
|
132
132
|
|
|
133
133
|
html = widget.render("test", self.child_page, {"id": "test-id"})
|
|
134
|
-
self.assertIn("Choose a page (Simple
|
|
134
|
+
self.assertIn("Choose a page (Simple page)", html)
|
|
135
135
|
|
|
136
136
|
def test_render_with_target_model_as_single_string(self):
|
|
137
137
|
widget = widgets.AdminPageChooser(target_models="tests.SimplePage")
|
|
@@ -143,7 +143,7 @@ class TestAdminPageChooserWidget(TestCase):
|
|
|
143
143
|
)
|
|
144
144
|
|
|
145
145
|
html = widget.render("test", self.child_page, {"id": "test-id"})
|
|
146
|
-
self.assertIn("Choose a page (Simple
|
|
146
|
+
self.assertIn("Choose a page (Simple page)", html)
|
|
147
147
|
|
|
148
148
|
def test_render_with_multiple_target_models(self):
|
|
149
149
|
target_models = [SimplePage, "tests.eventpage"]
|
|
@@ -43,6 +43,7 @@ from wagtail.signals import page_published, published
|
|
|
43
43
|
from wagtail.test.testapp.models import (
|
|
44
44
|
FullFeaturedSnippet,
|
|
45
45
|
ModeratedModel,
|
|
46
|
+
MultiPreviewModesPage,
|
|
46
47
|
SimplePage,
|
|
47
48
|
SimpleTask,
|
|
48
49
|
)
|
|
@@ -162,6 +163,33 @@ class TestWorkflowsIndexView(AdminTemplateTestUtils, WagtailTestUtils, TestCase)
|
|
|
162
163
|
self.assertNotContains(response, "There are no enabled workflows.")
|
|
163
164
|
self.assertContains(response, "test_workflow")
|
|
164
165
|
|
|
166
|
+
def test_multiple_snippets_assigned_to_workflow(self):
|
|
167
|
+
Workflow.objects.create(name="Nocontenttypes")
|
|
168
|
+
multi_ct_workflow = Workflow.objects.create(name="Multicontenttypes")
|
|
169
|
+
for model in [FullFeaturedSnippet, ModeratedModel]:
|
|
170
|
+
WorkflowContentType.objects.create(
|
|
171
|
+
workflow=multi_ct_workflow,
|
|
172
|
+
content_type=ContentType.objects.get_for_model(model),
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
response = self.get()
|
|
176
|
+
self.assertEqual(response.status_code, 200)
|
|
177
|
+
soup = self.get_soup(response.content)
|
|
178
|
+
cells = [
|
|
179
|
+
text
|
|
180
|
+
for td in soup.select("td")
|
|
181
|
+
if (text := td.get_text(separator=" | ", strip=True))
|
|
182
|
+
]
|
|
183
|
+
self.assertEqual(
|
|
184
|
+
cells,
|
|
185
|
+
[
|
|
186
|
+
"Multicontenttypes",
|
|
187
|
+
"0 pages | 2 snippet types",
|
|
188
|
+
"Nocontenttypes",
|
|
189
|
+
"0 pages | 0 snippet types",
|
|
190
|
+
],
|
|
191
|
+
)
|
|
192
|
+
|
|
165
193
|
def test_num_queries(self):
|
|
166
194
|
self.create_workflows()
|
|
167
195
|
self.get()
|
|
@@ -290,7 +318,15 @@ class TestWorkflowsIndexView(AdminTemplateTestUtils, WagtailTestUtils, TestCase)
|
|
|
290
318
|
self.assertContains(response, url + "?p=3")
|
|
291
319
|
|
|
292
320
|
response = self.get({"p": 4})
|
|
293
|
-
|
|
321
|
+
# Check response
|
|
322
|
+
self.assertEqual(response.status_code, 200)
|
|
323
|
+
self.assertTemplateUsed(response, "wagtailadmin/workflows/index.html")
|
|
324
|
+
|
|
325
|
+
# Check that we got the last page
|
|
326
|
+
self.assertEqual(
|
|
327
|
+
response.context["page_obj"].number,
|
|
328
|
+
response.context["paginator"].num_pages,
|
|
329
|
+
)
|
|
294
330
|
|
|
295
331
|
|
|
296
332
|
class TestWorkflowPermissions(WagtailTestUtils, TestCase):
|
|
@@ -981,7 +1017,7 @@ class TestTaskIndexView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
|
|
|
981
1017
|
self.assertEqual(response.status_code, 200)
|
|
982
1018
|
self.assertTemplateUsed(response, "wagtailadmin/workflows/task_index.html")
|
|
983
1019
|
self.assertBreadcrumbsItemsRendered(
|
|
984
|
-
[{"url": "", "label": "
|
|
1020
|
+
[{"url": "", "label": "Workflow tasks"}],
|
|
985
1021
|
response.content,
|
|
986
1022
|
)
|
|
987
1023
|
|
|
@@ -1199,7 +1235,15 @@ class TestTaskIndexView(AdminTemplateTestUtils, WagtailTestUtils, TestCase):
|
|
|
1199
1235
|
self.assertContains(response, url + "?p=3")
|
|
1200
1236
|
|
|
1201
1237
|
response = self.get({"p": 4})
|
|
1202
|
-
|
|
1238
|
+
# Check response
|
|
1239
|
+
self.assertEqual(response.status_code, 200)
|
|
1240
|
+
self.assertTemplateUsed(response, "wagtailadmin/workflows/task_index.html")
|
|
1241
|
+
|
|
1242
|
+
# Check that we got the last page
|
|
1243
|
+
self.assertEqual(
|
|
1244
|
+
response.context["page_obj"].number,
|
|
1245
|
+
response.context["paginator"].num_pages,
|
|
1246
|
+
)
|
|
1203
1247
|
|
|
1204
1248
|
def test_num_queries(self):
|
|
1205
1249
|
workflows = [Workflow.objects.create(name=f"workflow_{i}") for i in range(7)]
|
|
@@ -1877,7 +1921,7 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests):
|
|
|
1877
1921
|
self.assertNotContains(response, "Request changes")
|
|
1878
1922
|
self.assertNotContains(
|
|
1879
1923
|
response,
|
|
1880
|
-
'<button type="submit" class="button action-save
|
|
1924
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
1881
1925
|
)
|
|
1882
1926
|
|
|
1883
1927
|
# submit for approval
|
|
@@ -1893,7 +1937,7 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests):
|
|
|
1893
1937
|
self.assertNotContains(response, "Request changes")
|
|
1894
1938
|
self.assertContains(
|
|
1895
1939
|
response,
|
|
1896
|
-
'<button type="submit" class="button action-save
|
|
1940
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
1897
1941
|
)
|
|
1898
1942
|
|
|
1899
1943
|
# After submit, as a moderator, should only see save, approve, and reject buttons
|
|
@@ -1907,7 +1951,7 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests):
|
|
|
1907
1951
|
self.assertContains(response, "Request changes")
|
|
1908
1952
|
self.assertNotContains(
|
|
1909
1953
|
response,
|
|
1910
|
-
'<button type="submit" class="button action-save
|
|
1954
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
1911
1955
|
)
|
|
1912
1956
|
|
|
1913
1957
|
self.reject()
|
|
@@ -1923,7 +1967,7 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests):
|
|
|
1923
1967
|
self.assertNotContains(response, "Request changes")
|
|
1924
1968
|
self.assertNotContains(
|
|
1925
1969
|
response,
|
|
1926
|
-
'<button type="submit" class="button action-save
|
|
1970
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
1927
1971
|
)
|
|
1928
1972
|
|
|
1929
1973
|
# After cancel, as a submitter, should only see save and submit buttons
|
|
@@ -1936,7 +1980,7 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests):
|
|
|
1936
1980
|
self.assertNotContains(response, "Request changes")
|
|
1937
1981
|
self.assertNotContains(
|
|
1938
1982
|
response,
|
|
1939
|
-
'<button type="submit" class="button action-save
|
|
1983
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
1940
1984
|
)
|
|
1941
1985
|
|
|
1942
1986
|
def test_workflow_action_menu_items_when_reverting(self):
|
|
@@ -1956,7 +2000,7 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests):
|
|
|
1956
2000
|
self.assertNotContains(response, "Request changes")
|
|
1957
2001
|
self.assertNotContains(
|
|
1958
2002
|
response,
|
|
1959
|
-
'<button type="submit" class="button action-save
|
|
2003
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
1960
2004
|
)
|
|
1961
2005
|
|
|
1962
2006
|
# submit for approval
|
|
@@ -1972,7 +2016,7 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests):
|
|
|
1972
2016
|
self.assertNotContains(response, "Request changes")
|
|
1973
2017
|
self.assertContains(
|
|
1974
2018
|
response,
|
|
1975
|
-
'<button type="submit" class="button action-save
|
|
2019
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
1976
2020
|
)
|
|
1977
2021
|
|
|
1978
2022
|
# After submit, as a moderator, should only see save button
|
|
@@ -1986,7 +2030,7 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests):
|
|
|
1986
2030
|
self.assertNotContains(response, "Request changes")
|
|
1987
2031
|
self.assertNotContains(
|
|
1988
2032
|
response,
|
|
1989
|
-
'<button type="submit" class="button action-save
|
|
2033
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
1990
2034
|
)
|
|
1991
2035
|
|
|
1992
2036
|
self.reject()
|
|
@@ -2002,7 +2046,7 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests):
|
|
|
2002
2046
|
self.assertNotContains(response, "Request changes")
|
|
2003
2047
|
self.assertNotContains(
|
|
2004
2048
|
response,
|
|
2005
|
-
'<button type="submit" class="button action-save
|
|
2049
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
2006
2050
|
)
|
|
2007
2051
|
|
|
2008
2052
|
# After cancel, as a submitter, should only see save button
|
|
@@ -2016,7 +2060,7 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests):
|
|
|
2016
2060
|
self.assertNotContains(response, "Request changes")
|
|
2017
2061
|
self.assertNotContains(
|
|
2018
2062
|
response,
|
|
2019
|
-
'<button type="submit" class="button action-save
|
|
2063
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
2020
2064
|
)
|
|
2021
2065
|
|
|
2022
2066
|
@override_settings(WAGTAILADMIN_BASE_URL="http://admin.example.com")
|
|
@@ -2163,7 +2207,7 @@ class TestSubmitPageToWorkflow(BasePageWorkflowTests):
|
|
|
2163
2207
|
|
|
2164
2208
|
self.assertNotContains(
|
|
2165
2209
|
response,
|
|
2166
|
-
'<button type="submit" class="button action-save
|
|
2210
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
2167
2211
|
)
|
|
2168
2212
|
self.assertNotContains(
|
|
2169
2213
|
response,
|
|
@@ -2228,7 +2272,7 @@ class TestSubmitSnippetToWorkflowNotLockable(TestSubmitSnippetToWorkflow):
|
|
|
2228
2272
|
self.assertNotContains(response, "Request changes")
|
|
2229
2273
|
self.assertNotContains(
|
|
2230
2274
|
response,
|
|
2231
|
-
'<button type="submit" class="button action-save
|
|
2275
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
2232
2276
|
)
|
|
2233
2277
|
|
|
2234
2278
|
# submit for approval
|
|
@@ -2245,7 +2289,7 @@ class TestSubmitSnippetToWorkflowNotLockable(TestSubmitSnippetToWorkflow):
|
|
|
2245
2289
|
self.assertNotContains(response, "Request changes")
|
|
2246
2290
|
self.assertNotContains(
|
|
2247
2291
|
response,
|
|
2248
|
-
'<button type="submit" class="button action-save
|
|
2292
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
2249
2293
|
)
|
|
2250
2294
|
|
|
2251
2295
|
# After submit, as a moderator, should only see save, approve, and reject buttons
|
|
@@ -2259,7 +2303,7 @@ class TestSubmitSnippetToWorkflowNotLockable(TestSubmitSnippetToWorkflow):
|
|
|
2259
2303
|
self.assertContains(response, "Request changes")
|
|
2260
2304
|
self.assertNotContains(
|
|
2261
2305
|
response,
|
|
2262
|
-
'<button type="submit" class="button action-save
|
|
2306
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
2263
2307
|
)
|
|
2264
2308
|
|
|
2265
2309
|
self.reject()
|
|
@@ -2275,7 +2319,7 @@ class TestSubmitSnippetToWorkflowNotLockable(TestSubmitSnippetToWorkflow):
|
|
|
2275
2319
|
self.assertNotContains(response, "Request changes")
|
|
2276
2320
|
self.assertNotContains(
|
|
2277
2321
|
response,
|
|
2278
|
-
'<button type="submit" class="button action-save
|
|
2322
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
2279
2323
|
)
|
|
2280
2324
|
|
|
2281
2325
|
def test_workflow_action_menu_items_when_reverting(self):
|
|
@@ -2295,7 +2339,7 @@ class TestSubmitSnippetToWorkflowNotLockable(TestSubmitSnippetToWorkflow):
|
|
|
2295
2339
|
self.assertNotContains(response, "Request changes")
|
|
2296
2340
|
self.assertNotContains(
|
|
2297
2341
|
response,
|
|
2298
|
-
'<button type="submit" class="button action-save
|
|
2342
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
2299
2343
|
)
|
|
2300
2344
|
|
|
2301
2345
|
# submit for approval
|
|
@@ -2312,7 +2356,7 @@ class TestSubmitSnippetToWorkflowNotLockable(TestSubmitSnippetToWorkflow):
|
|
|
2312
2356
|
self.assertNotContains(response, "Request changes")
|
|
2313
2357
|
self.assertNotContains(
|
|
2314
2358
|
response,
|
|
2315
|
-
'<button type="submit" class="button action-save
|
|
2359
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
2316
2360
|
)
|
|
2317
2361
|
|
|
2318
2362
|
# After submit, as a moderator, should only see save button
|
|
@@ -2326,7 +2370,7 @@ class TestSubmitSnippetToWorkflowNotLockable(TestSubmitSnippetToWorkflow):
|
|
|
2326
2370
|
self.assertNotContains(response, "Request changes")
|
|
2327
2371
|
self.assertNotContains(
|
|
2328
2372
|
response,
|
|
2329
|
-
'<button type="submit" class="button action-save
|
|
2373
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
2330
2374
|
)
|
|
2331
2375
|
|
|
2332
2376
|
self.reject()
|
|
@@ -2342,7 +2386,7 @@ class TestSubmitSnippetToWorkflowNotLockable(TestSubmitSnippetToWorkflow):
|
|
|
2342
2386
|
self.assertNotContains(response, "Request changes")
|
|
2343
2387
|
self.assertNotContains(
|
|
2344
2388
|
response,
|
|
2345
|
-
'<button type="submit" class="button action-save
|
|
2389
|
+
'<button type="submit" class="button action-save" disabled>',
|
|
2346
2390
|
)
|
|
2347
2391
|
|
|
2348
2392
|
def test_submit_for_approval_changes_lock_status(self):
|
|
@@ -4117,12 +4161,15 @@ class TestTaskChooserChosenView(WagtailTestUtils, TestCase):
|
|
|
4117
4161
|
|
|
4118
4162
|
class TestWorkflowUsageView(WagtailTestUtils, TestCase):
|
|
4119
4163
|
def setUp(self):
|
|
4120
|
-
self.login()
|
|
4164
|
+
self.user = self.login()
|
|
4121
4165
|
self.workflow = Workflow.objects.get()
|
|
4122
4166
|
|
|
4123
4167
|
self.root_page = Page.objects.get(depth=1)
|
|
4124
4168
|
self.home_page = Page.objects.get(depth=2)
|
|
4125
4169
|
|
|
4170
|
+
self.child_page_with_default_workflow = self.home_page.add_child(
|
|
4171
|
+
instance=SimplePage(title="A page", content="I'm a page")
|
|
4172
|
+
)
|
|
4126
4173
|
self.child_page_with_another_workflow = self.home_page.add_child(
|
|
4127
4174
|
instance=SimplePage(title="Another page", content="I'm another page")
|
|
4128
4175
|
)
|
|
@@ -4137,11 +4184,109 @@ class TestWorkflowUsageView(WagtailTestUtils, TestCase):
|
|
|
4137
4184
|
)
|
|
4138
4185
|
|
|
4139
4186
|
self.assertEqual(response.status_code, 200)
|
|
4187
|
+
self.assertTemplateUsed(response, "wagtailadmin/pages/listing.html")
|
|
4188
|
+
|
|
4189
|
+
object_set = {page.id for page in response.context["object_list"]}
|
|
4190
|
+
# Should not contain child_page_with_another_workflow. It should also
|
|
4191
|
+
# not contain the root page, as it's irrelevant (you'll never be able to
|
|
4192
|
+
# edit and submit it to the workflow)
|
|
4193
|
+
self.assertEqual(
|
|
4194
|
+
object_set,
|
|
4195
|
+
{self.home_page.id, self.child_page_with_default_workflow.id},
|
|
4196
|
+
)
|
|
4197
|
+
|
|
4198
|
+
def test_with_no_permission(self):
|
|
4199
|
+
group = Group.objects.create(name="test group")
|
|
4200
|
+
self.user.is_superuser = False
|
|
4201
|
+
self.user.save()
|
|
4202
|
+
self.user.groups.add(group)
|
|
4203
|
+
group.permissions.add(
|
|
4204
|
+
Permission.objects.get(
|
|
4205
|
+
content_type__app_label="wagtailadmin", codename="access_admin"
|
|
4206
|
+
)
|
|
4207
|
+
)
|
|
4208
|
+
# No GroupPagePermission created
|
|
4209
|
+
|
|
4210
|
+
response = self.client.get(
|
|
4211
|
+
reverse("wagtailadmin_workflows:usage", args=[self.workflow.id])
|
|
4212
|
+
)
|
|
4213
|
+
self.assertEqual(response.status_code, 302)
|
|
4214
|
+
self.assertRedirects(response, reverse("wagtailadmin_home"))
|
|
4215
|
+
|
|
4216
|
+
# Only a page permission is created, but no workflow permission, not enough
|
|
4217
|
+
permission = GroupPagePermission.objects.create(
|
|
4218
|
+
group=group,
|
|
4219
|
+
page=Page.objects.first(),
|
|
4220
|
+
permission_type="change",
|
|
4221
|
+
)
|
|
4222
|
+
|
|
4223
|
+
response = self.client.get(
|
|
4224
|
+
reverse("wagtailadmin_workflows:usage", args=[self.workflow.id])
|
|
4225
|
+
)
|
|
4226
|
+
self.assertEqual(response.status_code, 302)
|
|
4227
|
+
self.assertRedirects(response, reverse("wagtailadmin_home"))
|
|
4228
|
+
|
|
4229
|
+
# Delete page permission and add workflow permission, also not enough
|
|
4230
|
+
permission.delete()
|
|
4231
|
+
group.permissions.add(
|
|
4232
|
+
Permission.objects.get(
|
|
4233
|
+
content_type__app_label="wagtailcore", codename="change_workflow"
|
|
4234
|
+
)
|
|
4235
|
+
)
|
|
4236
|
+
|
|
4237
|
+
response = self.client.get(
|
|
4238
|
+
reverse("wagtailadmin_workflows:usage", args=[self.workflow.id])
|
|
4239
|
+
)
|
|
4240
|
+
self.assertEqual(response.status_code, 302)
|
|
4241
|
+
self.assertRedirects(response, reverse("wagtailadmin_home"))
|
|
4242
|
+
|
|
4243
|
+
def test_with_minimal_permissions(self):
|
|
4244
|
+
group = Group.objects.create(name="test group")
|
|
4245
|
+
self.user.is_superuser = False
|
|
4246
|
+
self.user.save()
|
|
4247
|
+
self.user.groups.add(group)
|
|
4248
|
+
group.permissions.add(
|
|
4249
|
+
Permission.objects.get(
|
|
4250
|
+
content_type__app_label="wagtailadmin", codename="access_admin"
|
|
4251
|
+
),
|
|
4252
|
+
Permission.objects.get(
|
|
4253
|
+
content_type__app_label="wagtailcore", codename="change_workflow"
|
|
4254
|
+
),
|
|
4255
|
+
)
|
|
4256
|
+
GroupPagePermission.objects.create(
|
|
4257
|
+
group=group,
|
|
4258
|
+
page=Page.objects.first(),
|
|
4259
|
+
permission_type="change",
|
|
4260
|
+
)
|
|
4261
|
+
|
|
4262
|
+
# With a workflow permission and a page permission, the user should be
|
|
4263
|
+
# able to access the view
|
|
4264
|
+
response = self.client.get(
|
|
4265
|
+
reverse("wagtailadmin_workflows:usage", args=[self.workflow.id])
|
|
4266
|
+
)
|
|
4267
|
+
|
|
4268
|
+
self.assertEqual(response.status_code, 200)
|
|
4269
|
+
|
|
4270
|
+
def test_get_search_and_filtered_results(self):
|
|
4271
|
+
page_1 = SimplePage(title="Hello wagtail", content="test")
|
|
4272
|
+
page_2 = SimplePage(title="Hello django", content="test")
|
|
4273
|
+
self.home_page.add_child(instance=page_1)
|
|
4274
|
+
self.home_page.add_child(instance=page_2)
|
|
4275
|
+
self.home_page.add_child(instance=MultiPreviewModesPage(title="Hello python"))
|
|
4276
|
+
|
|
4277
|
+
response = self.client.get(
|
|
4278
|
+
reverse("wagtailadmin_workflows:usage_results", args=[self.workflow.id]),
|
|
4279
|
+
{
|
|
4280
|
+
"content_type": ContentType.objects.get_for_model(SimplePage).id,
|
|
4281
|
+
"q": "hello",
|
|
4282
|
+
},
|
|
4283
|
+
)
|
|
4284
|
+
|
|
4285
|
+
self.assertEqual(response.status_code, 200)
|
|
4286
|
+
self.assertTemplateUsed(response, "wagtailadmin/generic/listing_results.html")
|
|
4140
4287
|
|
|
4141
|
-
object_set = {page.id for page in response.context["
|
|
4142
|
-
self.
|
|
4143
|
-
self.assertIn(self.home_page.id, object_set)
|
|
4144
|
-
self.assertNotIn(self.child_page_with_another_workflow.id, object_set)
|
|
4288
|
+
object_set = {page.id for page in response.context["object_list"]}
|
|
4289
|
+
self.assertEqual(object_set, {page_1.id, page_2.id})
|
|
4145
4290
|
|
|
4146
4291
|
|
|
4147
4292
|
@freeze_time("2020-06-01 12:00:00")
|
wagtail/admin/tests/tests.py
CHANGED
|
@@ -29,7 +29,7 @@ class TestHome(WagtailTestUtils, TestCase):
|
|
|
29
29
|
def test_simple(self):
|
|
30
30
|
response = self.client.get(reverse("wagtailadmin_home"))
|
|
31
31
|
self.assertEqual(response.status_code, 200)
|
|
32
|
-
self.assertContains(response, "
|
|
32
|
+
self.assertContains(response, "Test Site")
|
|
33
33
|
|
|
34
34
|
def test_admin_menu(self):
|
|
35
35
|
response = self.client.get(reverse("wagtailadmin_home"))
|