#NEWLINE# def test_remote_addr( ) : #NEWLINE# #INDENT# ips = [ '1.2.3.4' , '2.3.4.5' , '3.4.5.6' ] #NEWLINE# env = dict ( copy . deepcopy ( env1 ) ) #NEWLINE# env [ 'HTTP_X_FORWARDED_FOR' ] = ', ' . join ( ips ) #NEWLINE# r = Request ( env ) #NEWLINE# assert ( r . remote_addr == ips [ 0 ] ) #NEWLINE# env = dict ( copy . deepcopy ( env1 ) ) #NEWLINE# env [ 'HTTP_X_FORWARDED_FOR' ] = ', ' . join ( ips ) #NEWLINE# env [ 'REMOTE_ADDR' ] = ips [ 1 ] #NEWLINE# r = Request ( env ) #NEWLINE# assert ( r . remote_addr == ips [ 0 ] ) #NEWLINE# env = dict ( copy . deepcopy ( env1 ) ) #NEWLINE# env [ 'REMOTE_ADDR' ] = ips [ 1 ] #NEWLINE# r = Request ( env ) #NEWLINE# assert ( r . remote_addr == ips [ 1 ] )