def test_keywords_conversion(self): yield self.perform_full_submission_actions() yield Delivery().run() data = {} data['type'] = 'tip' data['user'] = yield user.get_user(1, self.dummyReceiver_1['id'], u'en') data['context'] = yield admin.context.get_context( 1, self.dummyContext['id'], u'en') data['notification'] = yield tw(admin.notification.db_get_notification, 1, u'en') data['node'] = yield tw(admin.node.db_admin_serialize_node, 1, u'en') for tip in self.dummyRTips: if tip['receiver_id'] == self.dummyReceiver_1['id']: tip_id = tip['id'] break data['tip'], _ = yield rtip.get_rtip(1, self.dummyReceiver_1['id'], tip_id, u'en') data['comments'] = data['tip']['comments'] data['comment'] = data['comments'][0] data['messages'] = data['tip']['messages'] data['message'] = data['messages'][0] files = yield rtip.receiver_get_rfile_list(data['tip']['id']) data['file'] = files[0] for key in ['tip', 'comment', 'message', 'file']: data['type'] = key template = ''.join(supported_template_types[key].keyword_list) Templating().format_template(template, data)
def test_keywords_conversion(self): yield self.perform_full_submission_actions() yield DeliverySchedule().run() data = {} data['type'] = 'tip' data['receiver'] = yield admin.receiver.get_receiver(self.dummyReceiver_1['id'], 'en') data['context'] = yield admin.context.get_context(self.dummyContext['id'], 'en') data['notification'] = yield admin.notification.get_notification('en') data['node'] = yield admin.node.admin_serialize_node('en') if self.dummyRTips[0]['receiver_id'] == self.dummyReceiver_1['id']: tip_id = self.dummyRTips[0]['id'] else: tip_id = self.dummyRTips[1]['id'] data['tip'] = yield rtip.get_rtip(self.dummyReceiver_1['id'], tip_id, 'en') data['comment'] = data['tip']['comments'][0] data['message'] = data['tip']['messages'][0] files = yield rtip.receiver_get_rfile_list(data['tip']['id']) data['file'] = files[0] for key in ['tip', 'comment', 'message', 'file']: data['type'] = key template = ''.join(supported_template_types[key].keyword_list) ret = Templating().format_template(template, data)
def test_keywords_conversion(self): yield self.perform_full_submission_actions() yield DeliverySchedule().run() data = {} data['type'] = 'tip' data['receiver'] = yield admin.receiver.get_receiver( self.dummyReceiver_1['id'], 'en') data['context'] = yield admin.context.get_context( self.dummyContext['id'], 'en') data['notification'] = yield admin.notification.get_notification('en') data['node'] = yield admin.node.admin_serialize_node('en') if self.dummyRTips[0]['receiver_id'] == self.dummyReceiver_1['id']: tip_id = self.dummyRTips[0]['id'] else: tip_id = self.dummyRTips[1]['id'] data['tip'] = yield rtip.get_rtip(self.dummyReceiver_1['id'], tip_id, 'en') data['comment'] = data['tip']['comments'][0] data['message'] = data['tip']['messages'][0] files = yield rtip.receiver_get_rfile_list(data['tip']['id']) data['file'] = files[0] for key in ['tip', 'comment', 'message', 'file']: data['type'] = key template = ''.join(supported_template_types[key].keyword_list) ret = Templating().format_template(template, data)
def test_keywords_conversion(self): yield self.perform_full_submission_actions() yield Delivery().run() data = {} data['type'] = 'tip' data['user'] = yield user.get_user(1, self.dummyReceiver_1['id'], u'en') data['context'] = yield admin.context.get_context(1, self.dummyContext['id'], u'en') data['notification'] = yield tw(admin.notification.db_get_notification, 1, u'en') data['node'] = yield tw(admin.node.db_admin_serialize_node, 1, u'en') for tip in self.dummyRTips: if tip['receiver_id'] == self.dummyReceiver_1['id']: tip_id = tip['id'] break data['tip'], _ = yield rtip.get_rtip(1, self.dummyReceiver_1['id'], tip_id, u'en') data['comments'] = data['tip']['comments'] data['comment'] = data['comments'][0] data['messages'] = data['tip']['messages'] data['message'] = data['messages'][0] files = yield rtip.receiver_get_rfile_list(data['tip']['id']) data['file'] = files[0] for key in ['tip', 'comment', 'message', 'file']: data['type'] = key template = ''.join(supported_template_types[key].keyword_list) Templating().format_template(template, data)