#NEWLINE# def test_unit( db_conn , responses_table ) : #NEWLINE# #INDENT# '\n    Expect to require a unit ID.\n    ' #NEWLINE# ( response , errors ) = Response . insert ( db_conn , { #NEWLINE# #INDENT# 'user_id' : 'A' , #NEWLINE# 'card_id' : 'BC' , #NEWLINE# 'response' : 42 , #NEWLINE# 'score' : 0.9 , #NEWLINE# 'learned' : 0.9 , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( len ( errors ) == 1 ) #NEWLINE# response [ 'unit_id' ] = 'A24JLD' #NEWLINE# ( response , errors ) = response . save ( db_conn ) #NEWLINE# assert ( len ( response ) == 0 )