#NEWLINE# def test_get( self ) : #NEWLINE# #INDENT# data = self . get_data ( self . url ) #NEWLINE# self . assertEqual ( len ( data . keys ( ) ) , 1 ) #NEWLINE# self . assertEqual ( data [ 'detail' ] , 'Not found.' ) #NEWLINE# school = TestSchools . new_school ( ) #NEWLINE# user = school . advisor #NEWLINE# self . client . login ( username = user . username , password = 'test' ) #NEWLINE# data = self . get_data ( self . url ) #NEWLINE# self . assertEqual ( len ( data . keys ( ) ) , 7 ) #NEWLINE# self . assertEqual ( data [ 'id' ] , user . id ) #NEWLINE# self . assertEqual ( data [ 'username' ] , user . username ) #NEWLINE# self . assertEqual ( data [ 'first_name' ] , user . first_name ) #NEWLINE# self . assertEqual ( data [ 'last_name' ] , user . last_name ) #NEWLINE# self . assertEqual ( data [ 'user_type' ] , User . TYPE_ADVISOR ) #NEWLINE# self . assertEqual ( data [ 'school' ] , { #NEWLINE# #INDENT# 'id' : school . id , #NEWLINE# 'registered' : unicode ( school . registered . isoformat ( ) ) , #NEWLINE# 'name' : unicode ( school . name ) , #NEWLINE# 'address' : unicode ( school . address ) , #NEWLINE# 'city' : unicode ( school . city ) , #NEWLINE# 'state' : unicode ( school . state ) , #NEWLINE# 'zip_code' : unicode ( school . zip_code ) , #NEWLINE# 'country' : unicode ( school . country ) , #NEWLINE# 'primary_name' : unicode ( school . primary_name ) , #NEWLINE# 'primary_gender' : school . primary_gender , #NEWLINE# 'primary_email' : unicode ( school . primary_email ) , #NEWLINE# 'primary_phone' : unicode ( school . primary_phone ) , #NEWLINE# 'primary_type' : school . primary_type , #NEWLINE# 'secondary_name' : unicode ( school . secondary_name ) , #NEWLINE# 'secondary_gender' : school . secondary_gender , #NEWLINE# 'secondary_email' : unicode ( school . secondary_email ) , #NEWLINE# 'secondary_phone' : unicode ( school . secondary_phone ) , #NEWLINE# 'secondary_type' : school . secondary_type , #NEWLINE# 'program_type' : school . program_type , #NEWLINE# 'times_attended' : school . times_attended , #NEWLINE# 'international' : school . international , #NEWLINE# 'waitlist' : school . waitlist , #NEWLINE# 'beginner_delegates' : school . beginner_delegates , #NEWLINE# 'intermediate_delegates' : school . intermediate_delegates , #NEWLINE# 'advanced_delegates' : school . advanced_delegates , #NEWLINE# 'spanish_speaking_delegates' : school . spanish_speaking_delegates , #NEWLINE# 'chinese_speaking_delegates' : school . chinese_speaking_delegates , #NEWLINE# 'countrypreferences' : school . country_preference_ids , #NEWLINE# 'committeepreferences' : list ( school . committeepreferences . all ( ) ) , #NEWLINE# 'registration_comments' : unicode ( school . registration_comments ) , #NEWLINE# 'fees_owed' : float ( school . fees_owed ) , #NEWLINE# 'fees_paid' : float ( school . fees_paid ) , #NEWLINE# 'assignments_finalized' : school . assignments_finalized , #NEWLINE# #UNINDENT# } )