#NEWLINE# def test_response( db_conn , responses_table ) : #NEWLINE# #INDENT# "\n    Expect to record the user's response.\n    " #NEWLINE# ( response , errors ) = Response . insert ( db_conn , { #NEWLINE# #INDENT# 'user_id' : 'A' , #NEWLINE# 'card_id' : 'BC' , #NEWLINE# 'unit_id' : 'RM' , #NEWLINE# 'score' : 0.9 , #NEWLINE# 'learned' : 0.9 , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( len ( errors ) == 1 ) #NEWLINE# response [ 'response' ] = 42 #NEWLINE# ( response , errors ) = response . save ( errors ) #NEWLINE# assert ( len ( errors ) == 0 )