'For help understanding what this tests for, see:
http://articles.sitepoint.com/print/hierarchical-data-database
Creates this published structure:
home
/                             item1   item2
/                              subitem1 subitem2'

def test_publish_works_with_descendants(self):

    home_page = create_page('home', 'nav_playground.html', 'en', published=True, in_navigation=False)
    create_page('item1', 'nav_playground.html', 'en', parent=home_page, published=True)
    item2 = create_page('item2', 'nav_playground.html', 'en', parent=home_page, published=True)
    create_page('subitem1', 'nav_playground.html', 'en', parent=item2, published=True)
    create_page('subitem2', 'nav_playground.html', 'en', parent=item2, published=True)
    item2 = item2.reload()
    not_drafts = list(Page.objects.filter(publisher_is_draft=False).order_by('path'))
    drafts = list(Page.objects.filter(publisher_is_draft=True).order_by('path'))
    self.assertEqual(len(not_drafts), 5)
    self.assertEqual(len(drafts), 5)
    for (idx, draft) in enumerate(drafts):
        public = not_drafts[idx]
        self.assertEqual(bool(public.parent_id), bool(draft.parent_id))
        if public.parent:
            self.assertEqual(public.path[0:4], public.parent.path[0:4])
            self.assertTrue((public.parent in public.get_ancestors()))
            self.assertTrue((public in public.parent.get_descendants()))
            self.assertTrue((public in public.parent.get_children()))
        if draft.parent:
            self.assertEqual(draft.path[0:4], draft.parent.path[0:4])
            self.assertTrue((draft.parent in draft.get_ancestors()))
            self.assertTrue((draft in draft.parent.get_descendants()))
            self.assertTrue((draft in draft.parent.get_children()))
    item2.publish('en')
    not_drafts = list(Page.objects.filter(publisher_is_draft=False).order_by('path'))
    drafts = list(Page.objects.filter(publisher_is_draft=True).order_by('path'))
    self.assertEqual(len(not_drafts), 5)
    self.assertEqual(len(drafts), 5)
    for (idx, draft) in enumerate(drafts):
        public = not_drafts[idx]
        self.assertEqual(bool(public.parent_id), bool(draft.parent_id))
        self.assertEqual(public.numchild, draft.numchild)
        if public.parent:
            self.assertEqual(public.path[0:4], public.parent.path[0:4])
            self.assertTrue((public.parent in public.get_ancestors()))
            self.assertTrue((public in public.parent.get_descendants()))
            self.assertTrue((public in public.parent.get_children()))
        if draft.parent:
            self.assertEqual(draft.path[0:4], draft.parent.path[0:4])
            self.assertTrue((draft.parent in draft.get_ancestors()))
            self.assertTrue((draft in draft.parent.get_descendants()))
            self.assertTrue((draft in draft.parent.get_children()))
