#NEWLINE# def setUp( self ) : #NEWLINE# #INDENT# for doc in get_all_forms_in_all_domains ( ) : #NEWLINE# #INDENT# if ( doc . xmlns in [ XMLNS_DOTS_FORM , XMLNS_PATIENT_UPDATE_DOT ] ) : #NEWLINE# #INDENT# doc . delete ( ) #NEWLINE# #UNINDENT# #UNINDENT# two_weeks = timedelta ( days = 14 ) #NEWLINE# self . domain = Domain ( ) #NEWLINE# self . domain . name = PACT_DOMAIN #NEWLINE# self . domain . is_active = True #NEWLINE# self . domain . date_created = ( datetime . utcnow ( ) - fin ) #NEWLINE# self . domain . save ( ) #NEWLINE# self . submit_url = ( '/a/%s/receiver' % self . domain . name ) #NEWLINE# self . user = CommCareUser . create ( self . domain . name , 'ctsims' , 'mockmock' , uuid = CTSIMS_ID ) #NEWLINE# nonart_case_regimens = regimen_dict_from_choice ( DOT_NONART , 'morning,evening,bedtime' ) #NEWLINE# art_case_regimens = regimen_dict_from_choice ( DOT_ART , 'morning,noon' ) #NEWLINE# props = { #NEWLINE# #INDENT# '_id' : CASE_ID , #NEWLINE# 'dot_status' : 'DOT1' , #NEWLINE# 'domain' : self . domain . name , #NEWLINE# #UNINDENT# } #NEWLINE# props . update ( nonart_case_regimens ) #NEWLINE# props . update ( art_case_regimens ) #NEWLINE# case = CommCareCase ( ** props ) #NEWLINE# case . save ( ) #NEWLINE# self . pillbox_form = '' #NEWLINE# with open ( os . path . join ( os . path . abspath ( os . path . dirname ( __file__ ) ) , 'dots_data' , '01_pillbox.xml' ) ) as fin : #NEWLINE# #INDENT# self . pillbox_form = fin . read ( ) #NEWLINE# #UNINDENT# self . no_pillbox_form = '' #NEWLINE# with open ( os . path . join ( os . path . abspath ( os . path . dirname ( __file__ ) ) , 'dots_data' , '02_no_pillbox.xml' ) ) as fin : #NEWLINE# #INDENT# self . no_pillbox_form = fin . read ( ) #NEWLINE# #UNINDENT# self . no_pillbox_form2 = '' #NEWLINE# with open ( os . path . join ( os . path . abspath ( os . path . dirname ( __file__ ) ) , 'dots_data' , '03_no_pillbox.xml' ) ) as fin : #NEWLINE# #INDENT# self . no_pillbox_form2 = fin . read ( )