'Unpub1 was never published, and unpub2 has been unpublished after the
fact. None of the grandchildren should become published.'

def test_republish_with_unpublished_child(self):

    home = self.create_page('Home', published=True)
    unpub1 = self.create_page('Unpub1', published=False, parent=home)
    unpub2 = self.create_page('Unpub2', published=True, parent=home)
    gc1 = self.create_page('GC1', published=True, parent=unpub1)
    gc2 = self.create_page('GC2', published=True, parent=unpub2)
    self.assertFalse(gc1.publisher_public_id)
    self.assertFalse(gc1.publisher_public_id)
    self.assertTrue(gc1.is_published('en'))
    self.assertTrue(gc2.is_published('en'))
    home = self.reload(home)
    home.unpublish('en')
    unpub1 = self.reload(unpub1)
    unpub2 = self.reload(unpub2)
    unpub2.unpublish('en')
    for page in (unpub1, unpub2):
        self.assertFalse(page.is_published('en'), page)
        self.assertEqual(page.get_publisher_state('en'), PUBLISHER_STATE_DIRTY)
    self.assertIsNone(unpub1.publisher_public)
    self.assertIsNotNone(unpub2.publisher_public)
    self.assertFalse(unpub2.publisher_public.is_published('en'))
    gc1 = self.reload(gc1)
    gc2 = self.reload(gc2)
    for page in (gc1, gc2):
        self.assertTrue(page.is_published('en'))
        self.assertEqual(page.get_publisher_state('en'), PUBLISHER_STATE_PENDING)
    self.assertIsNone(gc1.publisher_public)
    self.assertIsNotNone(gc2.publisher_public)
    self.assertFalse(gc2.publisher_public.is_published('en'))
