def test_01_set_body_pagelink(self):
    'Test the get_body_pagelink_ids and set_body_pagelink functions.'
    self.set_setting('PAGE_LINK_FILTER', True)
    page1 = self.create_new_page()
    page2 = self.create_new_page()
    content_string = 'test <a href="%s" class="page_%d">hello</a>'
    content = Content(page=page2, language='en-us', type='body', body=(content_string % ('#', page1.id)))
    content.save()
    self.assertEqual(Content.objects.get_content(page2, 'en-us', 'body'), (content_string % (page1.get_url_path(), page1.id)))
    self.assertFalse(page2.has_broken_link())
    page1.delete()
    self.assertEqual(Content.objects.get_content(page2, 'en-us', 'body'), 'test <a href="#" class="pagelink_broken">hello</a>')
    self.assertTrue(page2.has_broken_link())
Test the get_body_pagelink_ids and set_body_pagelink functions.
def test_01_set_body_pagelink(self):
    
    self.set_setting('PAGE_LINK_FILTER', True)
    page1 = self.create_new_page()
    page2 = self.create_new_page()
    content_string = 'test <a href="%s" class="page_%d">hello</a>'
    content = Content(page=page2, language='en-us', type='body', body=(content_string % ('#', page1.id)))
    content.save()
    self.assertEqual(Content.objects.get_content(page2, 'en-us', 'body'), (content_string % (page1.get_url_path(), page1.id)))
    self.assertFalse(page2.has_broken_link())
    page1.delete()
    self.assertEqual(Content.objects.get_content(page2, 'en-us', 'body'), 'test <a href="#" class="pagelink_broken">hello</a>')
    self.assertTrue(page2.has_broken_link())