#NEWLINE# @ run_with_all_backends #NEWLINE# def testCreateThenClose( self ) : #NEWLINE# #INDENT# ( xform1 , case ) = bootstrap_case_from_xml ( self , 'create.xml' ) #NEWLINE# ( xform2 , case ) = bootstrap_case_from_xml ( self , 'close.xml' , case . case_id ) #NEWLINE# self . assertEqual ( True , case . closed ) #NEWLINE# if settings . TESTS_SHOULD_USE_SQL_BACKEND : #NEWLINE# #INDENT# self . _check_transactions ( case , [ xform1 , xform2 ] ) #NEWLINE# self . assertTrue ( case . transactions [ 0 ] . is_case_create ) #NEWLINE# self . assertTrue ( case . transactions [ 1 ] . is_case_close ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . assertEqual ( 3 , len ( case . actions ) ) #NEWLINE# update_action = case . actions [ 1 ] #NEWLINE# close_action = case . actions [ 2 ] #NEWLINE# self . assertEqual ( const . CASE_ACTION_UPDATE , update_action . action_type ) #NEWLINE# self . assertEqual ( const . CASE_ACTION_CLOSE , close_action . action_type ) #NEWLINE# self . assertEqual ( 'http://openrosa.org/case/test/close' , close_action . xform_xmlns ) #NEWLINE# self . assertEqual ( '' , close_action . xform_name ) #NEWLINE# self . assertEqual ( 'abcde' , update_action . updated_unknown_properties [ 'someprop' ] ) #NEWLINE# self . assertEqual ( 'case closed' , update_action . updated_unknown_properties [ 'someclosedprop' ] ) #NEWLINE# self . assertEqual ( CLOSE_DATE , close_action . date ) #NEWLINE# #UNINDENT# self . assertEqual ( 'abcde' , case . dynamic_case_properties ( ) [ 'someprop' ] ) #NEWLINE# self . assertEqual ( 'case closed' , case . dynamic_case_properties ( ) [ 'someclosedprop' ] ) #NEWLINE# self . assertEqual ( CLOSE_DATE , case . modified_on )