#NEWLINE# def test_update_site_and_page_choices( self ) : #NEWLINE# #INDENT# Site . objects . all ( ) . delete ( ) #NEWLINE# site = Site . objects . create ( domain = 'http://www.django-cms.org' , name = 'Django CMS' , pk = 1 ) #NEWLINE# page1 = create_page ( 'Page 1' , 'nav_playground.html' , 'en' , site = site ) #NEWLINE# page2 = create_page ( 'Page 2' , 'nav_playground.html' , 'de' , site = site ) #NEWLINE# page3 = create_page ( 'Page 3' , 'nav_playground.html' , 'en' , site = site , parent = page1 ) #NEWLINE# page4 = create_page ( 'Page 4<script>alert("bad-things");</script>' , 'nav_playground.html' , 'en' , site = site , parent = page1 ) #NEWLINE# ( site_choices , page_choices ) = [ list ( bit ) for bit in update_site_and_page_choices ( 'en' ) ] #NEWLINE# self . assertEqual ( page_choices , [ ( '' , '----' ) , ( site . name , [ ( page1 . pk , 'Page 1' ) , ( page3 . pk , '&nbsp;&nbsp;Page 3' ) , ( self . pk , '&nbsp;&nbsp;Page 4&lt;script&gt;alert(&quot;bad-things&quot;);&lt;/script&gt;' ) , ( page2 . pk , 'Page 2' ) ] ) ] ) #NEWLINE# self . assertEqual ( site_choices , [ ( site . pk , site . name ) ] )