kopia lustrzana https://github.com/wagtail/wagtail
add new fixtures to test subpage_types business rules when moving pages
rodzic
72892644bb
commit
3e127ebe03
|
@ -38,7 +38,7 @@
|
|||
"model": "wagtailcore.page",
|
||||
"fields": {
|
||||
"title": "Events",
|
||||
"numchild": 5,
|
||||
"numchild": 6,
|
||||
"show_in_menus": true,
|
||||
"live": true,
|
||||
"depth": 3,
|
||||
|
@ -394,6 +394,52 @@
|
|||
"locked": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"pk": 15,
|
||||
"model": "wagtailcore.page",
|
||||
"fields": {
|
||||
"title": "Businessy events",
|
||||
"numchild": 1,
|
||||
"show_in_menus": true,
|
||||
"live": false,
|
||||
"depth": 4,
|
||||
"content_type": ["tests", "businessindex"],
|
||||
"path": "0001000100010006",
|
||||
"url_path": "/home/events/businessy-events/",
|
||||
"slug": "businessy-events",
|
||||
"owner": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"pk": 15,
|
||||
"model": "tests.businessindex",
|
||||
"fields": {
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"pk": 16,
|
||||
"model": "wagtailcore.page",
|
||||
"fields": {
|
||||
"title": "Board meetings",
|
||||
"numchild": 0,
|
||||
"show_in_menus": true,
|
||||
"live": false,
|
||||
"depth": 5,
|
||||
"content_type": ["tests", "businesssubindex"],
|
||||
"path": "00010001000100060001",
|
||||
"url_path": "/home/events/businessy-events/board-meetings/",
|
||||
"slug": "board-meetings",
|
||||
"owner": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"pk": 16,
|
||||
"model": "tests.businesssubindex",
|
||||
"fields": {
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"pk": 1,
|
||||
"model": "wagtailcore.site",
|
||||
|
|
|
@ -80,7 +80,9 @@ class TestFixTreeCommand(TestCase):
|
|||
# Check that the issues were detected
|
||||
output_string = output.read()
|
||||
self.assertIn("Incorrect numchild value found for pages: [2]", output_string)
|
||||
self.assertIn("Orphaned pages found: [4, 5, 6, 9, 13]", output_string)
|
||||
# Note that page ID 15 was also deleted, but is not picked up here, as
|
||||
# it is a child of 14.
|
||||
self.assertIn("Orphaned pages found: [4, 5, 6, 9, 13, 15]", output_string)
|
||||
|
||||
# Check that christmas_page is still in the tree
|
||||
self.assertTrue(Page.objects.filter(id=christmas_page.id).exists())
|
||||
|
@ -102,7 +104,7 @@ class TestFixTreeCommand(TestCase):
|
|||
# Check that the issues were detected
|
||||
output_string = output.read()
|
||||
self.assertIn("Incorrect numchild value found for pages: [2]", output_string)
|
||||
self.assertIn("5 orphaned pages deleted.", output_string)
|
||||
self.assertIn("7 orphaned pages deleted.", output_string)
|
||||
|
||||
# Check that christmas_page has been deleted
|
||||
self.assertFalse(Page.objects.filter(id=christmas_page.id).exists())
|
||||
|
|
Ładowanie…
Reference in New Issue