#NEWLINE# def test_delete( backend ) : #NEWLINE# #INDENT# actor = Actor ( { #NEWLINE# #INDENT# 'foo' : 'bar' , #NEWLINE# #UNINDENT# } ) #NEWLINE# backend . save ( actor ) #NEWLINE# backend . commit ( ) #NEWLINE# assert ( actor . foo == 'bar' ) #NEWLINE# assert ( backend . get ( Actor , { #NEWLINE# #INDENT# 'pk' : actor . pk , #NEWLINE# #UNINDENT# } ) . foo == 'bar' ) #NEWLINE# del actor . foo #NEWLINE# with pytest . raises ( AttributeError ) : #NEWLINE# #INDENT# actor . foo #NEWLINE# #UNINDENT# with pytest . raises ( KeyError ) : #NEWLINE# #INDENT# actor [ 'foo' ] #NEWLINE# #UNINDENT# backend . save ( actor ) #NEWLINE# backend . commit ( ) #NEWLINE# with pytest . raises ( AttributeError ) : #NEWLINE# #INDENT# backend . get ( Actor , { #NEWLINE# #INDENT# 'pk' : actor . pk , #NEWLINE# #UNINDENT# } ) . foo