def fill_data(self): # fill_data/create_admin self.dummyAdminUser = yield create_admin_user(copy.deepcopy(self.dummyAdminUser), 'en') # fill_data/create_custodian self.dummyCustodianUser = yield create_custodian_user(copy.deepcopy(self.dummyCustodianUser), 'en') # fill_data/create_receiver self.dummyReceiver_1 = yield create_receiver_user(copy.deepcopy(self.dummyReceiver_1), 'en') self.dummyReceiverUser_1['id'] = self.dummyReceiver_1['id'] self.dummyReceiver_2 = yield create_receiver_user(copy.deepcopy(self.dummyReceiver_2), 'en') self.dummyReceiverUser_2['id'] = self.dummyReceiver_2['id'] receivers_ids = [self.dummyReceiver_1['id'], self.dummyReceiver_2['id']] # fill_data/create_context self.dummyContext['receivers'] = receivers_ids self.dummyContext = yield create_context(copy.deepcopy(self.dummyContext), 'en') self.dummyQuestionnaire = yield get_questionnaire(self.dummyContext['questionnaire_id'], 'en') self.dummyQuestionnaire['steps'].append(get_dummy_step()) self.dummyQuestionnaire['steps'][1]['questionnaire_id'] = self.dummyContext['questionnaire_id'] self.dummyQuestionnaire['steps'][1]['label'] = 'Whistleblower identity' self.dummyQuestionnaire['steps'][1]['presentation_order'] = 1 self.dummyQuestionnaire['steps'][1] = yield create_step(self.dummyQuestionnaire['steps'][1], 'en') if self.complex_field_population: yield self.add_whistleblower_identity_field_to_step(self.dummyQuestionnaire['steps'][1]['id'])
def fill_data(self): # fill_data/create_admin self.dummyAdminUser = yield create_admin_user(copy.deepcopy(self.dummyAdminUser), 'en') # fill_data/create_custodian self.dummyCustodianUser = yield create_custodian_user(copy.deepcopy(self.dummyCustodianUser), 'en') # fill_data/create_receiver self.dummyReceiver_1 = yield create_receiver(copy.deepcopy(self.dummyReceiver_1), 'en') self.dummyReceiverUser_1['id'] = self.dummyReceiver_1['id'] self.dummyReceiver_2 = yield create_receiver(copy.deepcopy(self.dummyReceiver_2), 'en') self.dummyReceiverUser_2['id'] = self.dummyReceiver_2['id'] receivers_ids = [self.dummyReceiver_1['id'], self.dummyReceiver_2['id']] # fill_data/create_context self.dummyContext['receivers'] = receivers_ids self.dummyContext = yield create_context(copy.deepcopy(self.dummyContext), 'en') self.dummyQuestionnaire = yield get_questionnaire(self.dummyContext['questionnaire_id'], 'en') self.dummyQuestionnaire['steps'].append(get_dummy_step()) self.dummyQuestionnaire['steps'][1]['questionnaire_id'] = self.dummyContext['questionnaire_id'] self.dummyQuestionnaire['steps'][1]['label'] = 'Whistleblower identity' self.dummyQuestionnaire['steps'][1]['presentation_order'] = 1 self.dummyQuestionnaire['steps'][1] = yield create_step(self.dummyQuestionnaire['steps'][1], 'en') if self.complex_field_population: yield self.add_whistleblower_identity_field_to_step(self.dummyQuestionnaire['steps'][1]['id'])