#NEWLINE# def test_post_with_anonymous_user( self ) : #NEWLINE# #INDENT# '\n        Updating user profile with anonymous user should redirect to the login\n        page.\n        ' #NEWLINE# self . request . method = 'POST' #NEWLINE# self . request . user = AnonymousUser ( ) #NEWLINE# self . request . POST = { #NEWLINE# #INDENT# 'display_name' : 'Test User' , #NEWLINE# 'email' : 'test-user@example.com' , #NEWLINE# #UNINDENT# } #NEWLINE# response = self . view ( self . request ) #NEWLINE# self . assertEqual ( response . status_code , 302 ) #NEWLINE# self . assertIn ( '/admin/account/login/' , response [ 'location' ] )