-
Notifications
You must be signed in to change notification settings - Fork 10
Preservar a ordem das subpáginas após edição #1429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,9 +6,29 @@ | |
| from core.users.models import User | ||
| from journal.models import Journal, SciELOJournal | ||
|
|
||
| from core.home.models import AboutScieloOrgPage, HomePage | ||
| from core.home.views import _get_scielo_journals_data | ||
|
|
||
|
|
||
| class TestSubpageAdminDefaultOrdering(TestCase): | ||
|
||
| """Regression tests for issue: | ||
| "Edição de páginas causa reordenamento dos itens". | ||
|
|
||
| Wagtail's default ``admin_default_ordering`` of | ||
| ``-latest_revision_created_at`` would cause a recently edited subpage | ||
| to jump to the top of the children listing in the admin, breaking | ||
| the predefined order. The fix sets ``admin_default_ordering = "ord"`` | ||
| on the relevant page models so that children are always listed in | ||
| their tree (manual) order, matching the public-facing site. | ||
| """ | ||
|
|
||
| def test_about_scielo_org_page_uses_tree_ordering_in_admin(self): | ||
| self.assertEqual(AboutScieloOrgPage.admin_default_ordering, "ord") | ||
|
|
||
| def test_home_page_uses_tree_ordering_in_admin(self): | ||
| self.assertEqual(HomePage.admin_default_ordering, "ord") | ||
|
Comment on lines
+25
to
+29
|
||
|
|
||
|
|
||
| class TestGetScieloJournalsData(TestCase): | ||
| def setUp(self): | ||
| self.user = User.objects.create(username="testuser", password="testpass") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import grouping/order here looks like it will be reformatted by isort (CI runs pre-commit with isort). Consider running isort or reorganizing imports so local-app imports (collection/journal/core.*) are in a single section and sorted consistently, rather than splitting
core.home.*into a separate block.