#NEWLINE# def test_view_authenticated_flatpage( self ) : #NEWLINE# #INDENT# 'A flatpage served through a view can require authentication' #NEWLINE# response = self . client . get ( '/flatpage_root/sekrit/' ) #NEWLINE# self . assertRedirects ( response , '/accounts/login/?next=/flatpage_root/sekrit/' ) #NEWLINE# User . objects . create_user ( 'testuser' , 'test@example.com' , 's3krit' ) #NEWLINE# self . client . login ( username = 'testuser' , password = 's3krit' ) #NEWLINE# response = self . client . get ( '/flatpage_root/sekrit/' ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# self . assertContains ( self , "<p>Isn't it sekrit!</p>" )