#NEWLINE# def test_create_new_anonymous_customer( self ) : #NEWLINE# #INDENT# '\n        Test that CustomerMiddleware creates an anonymous Customer for\n        AnonymousUser.\n        ' #NEWLINE# request = self . factory . get ( '/' , follow = True ) #NEWLINE# request . user = AnonymousUser ( ) #NEWLINE# request . session = { #NEWLINE# #INDENT# 'session_key' : 'anon1234' , #NEWLINE# #UNINDENT# } #NEWLINE# self . cm . process_request ( request ) #NEWLINE# self . assertTrue ( request . customer ) #NEWLINE# self . assertEqual ( request . customer . user , None )