#NEWLINE# def test_push( self ) : #NEWLINE# #INDENT# with HTTMock ( form_list_xml ) : #NEWLINE# #INDENT# self . bc . download_xforms ( ) #NEWLINE# #UNINDENT# with HTTMock ( instances_xml ) : #NEWLINE# #INDENT# self . bc . download_instances ( self . xform . id_string ) #NEWLINE# #UNINDENT# XForm . objects . all ( ) . delete ( ) #NEWLINE# xforms = XForm . objects . filter ( user = self . user , id_string = self . xform . id_string ) #NEWLINE# self . assertTrue ( ( xforms . count ( ) == 0 ) ) #NEWLINE# instances = Instance . objects . filter ( xform__user = self . user , xform__id_string = self . xform . id_string ) #NEWLINE# self . assertTrue ( ( instances . count ( ) == 0 ) ) #NEWLINE# self . bc . push ( ) #NEWLINE# xforms = XForm . objects . filter ( user = self . user , id_string = self . xform . id_string ) #NEWLINE# self . assertTrue ( ( xforms . count ( ) == 1 ) ) #NEWLINE# instances = Instance . objects . filter ( xform__user = xforms . user , xform__id_string = self . xform . id_string ) #NEWLINE# self . assertTrue ( ( instances . count ( ) == 1 ) )