#NEWLINE# def test_user_location( self ) : #NEWLINE# #INDENT# i = 0 #NEWLINE# for country in COUNTRIES : #NEWLINE# #INDENT# if ( country in STATES ) : #NEWLINE# #INDENT# for state in STATES [ country ] : #NEWLINE# #INDENT# set_location ( _states . conn , i , country , state ) #NEWLINE# i += 1 #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# set_location ( self . conn , i , country , '' ) #NEWLINE# i += 1 #NEWLINE# #UNINDENT# #UNINDENT# ( _countries , _states ) = aggregate_location ( self . conn ) #NEWLINE# ( countries , states ) = aggregate_location_list ( self . conn , range ( ( i + 1 ) ) ) #NEWLINE# self . assertEquals ( _countries , countries ) #NEWLINE# self . assertEquals ( _states , states ) #NEWLINE# for c in countries : #NEWLINE# #INDENT# if ( c in STATES ) : #NEWLINE# #INDENT# self . assertEquals ( len ( STATES [ c ] ) , countries [ c ] ) #NEWLINE# for s in STATES [ c ] : #NEWLINE# #INDENT# self . assertEquals ( states [ c ] [ s ] , 1 ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . assertEquals ( countries [ c ] , 1 )