#NEWLINE# def test_move_page_integrity( self ) : #NEWLINE# #INDENT# superuser = self . get_superuser ( ) #NEWLINE# with self . login_user_context ( superuser ) : #NEWLINE# #INDENT# page_home = self . get_new_page_data ( ) #NEWLINE# self . client . post ( URL_CMS_PAGE_ADD , page_home ) #NEWLINE# page_root = create_page ( 'Parent' , 'col_three.html' , 'en' ) #NEWLINE# page_root . publish ( 'en' ) #NEWLINE# page_child_1 = create_page ( 'Child 1' , template = constants . TEMPLATE_INHERITANCE_MAGIC , language = 'en' , parent = page_root ) #NEWLINE# page_child_1 . publish ( 'en' ) #NEWLINE# page_child_2 = create_page ( 'Child 2' , template = constants . TEMPLATE_INHERITANCE_MAGIC , language = 'en' , parent = page_root ) #NEWLINE# page_child_2 . publish ( 'en' ) #NEWLINE# page_child_3 = create_page ( 'Child 3' , 'col_three.html' , 'en' ) #NEWLINE# page_child_4 = create_page ( 'Child 4' , 'col_three.html' , 'en' , published = True ) #NEWLINE# data = { #NEWLINE# #INDENT# 'id' : page_child_3 . pk , #NEWLINE# 'target' : page_root . pk , #NEWLINE# 'position' : '0' , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( ( URL_CMS_PAGE_MOVE % page_child_3 . pk ) , data ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# page_child_4 . unpublish ( 'en' ) #NEWLINE# data = { #NEWLINE# #INDENT# 'id' : page_child_4 . pk , #NEWLINE# 'target' : page_root . pk , #NEWLINE# 'position' : '0' , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . client . post ( ( URL_CMS_PAGE_MOVE % page_child_4 . pk ) , data ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# page_root = page_root . reload ( ) #NEWLINE# page_child_4 = page_child_4 . reload ( ) #NEWLINE# self . assertEqual ( page_root . get_descendants ( ) . count ( ) , 4 ) #NEWLINE# self . assertEqual ( page_child_3 . get_publisher_state ( 'en' ) , PUBLISHER_STATE_DIRTY ) #NEWLINE# self . assertEqual ( page_child_3 . is_published ( 'en' ) , False ) #NEWLINE# self . assertEqual ( page_child_4 . get_publisher_state ( 'en' ) , PUBLISHER_STATE_DIRTY ) #NEWLINE# self . assertEqual ( page_child_4 . is_published ( 'en' ) , False ) #NEWLINE# self . assertEqual ( page_child_4 . publisher_public . get_publisher_state ( 'en' ) , PUBLISHER_STATE_DEFAULT ) #NEWLINE# self . assertEqual ( page_child_4 . publisher_public . is_published ( 'en' ) , False ) #NEWLINE# self . assertEqual ( page_child_1 . get_publisher_state ( 'en' ) , PUBLISHER_STATE_DEFAULT ) #NEWLINE# self . assertEqual ( page_child_1 . is_published ( 'en' ) , True ) #NEWLINE# self . assertEqual ( page_child_2 . get_publisher_state ( 'en' ) , PUBLISHER_STATE_DEFAULT ) #NEWLINE# self . assertEqual ( page_child_2 . is_published ( 'en' ) , True )