def setup_responses(self): DeliveryNode.objects.all().delete() MultipleChoiceQuestion.objects.all().delete() from eums.fixtures.end_user_questions import seed_questions questions, options = seed_questions() po_item = PurchaseOrderItemFactory(quantity=100, value=1000) end_user_node_one = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, quantity=10, item=po_item) MultipleChoiceAnswerFactory(run=RunFactory( runnable=end_user_node_one, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_RECEIVED']) self.programme = ProgrammeFactory(name='my-program') self.ip = ConsigneeFactory() distribution_plan = DeliveryFactory(programme=self.programme, track=True) self.today = FakeDate.today() self.end_user_node_two = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, quantity=20, item=po_item, distribution_plan=distribution_plan) MultipleChoiceAnswerFactory(run=RunFactory( runnable=self.end_user_node_two, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_RECEIVED']) end_user_node_three = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, quantity=30, item=po_item, distribution_plan=distribution_plan, ip=self.ip, consignee=self.ip, delivery_date=self.today + datetime.timedelta(days=3)) MultipleChoiceAnswerFactory(run=RunFactory( runnable=end_user_node_three, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED']) end_user_node_four = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, quantity=40, item=po_item) MultipleChoiceAnswerFactory(run=RunFactory( runnable=end_user_node_four, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED']) end_user_node_five = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, quantity=50, item=po_item) MultipleChoiceAnswerFactory(run=RunFactory( runnable=end_user_node_five, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED']) non_response_node = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, track=True, quantity=60, item=po_item) RunFactory(runnable=non_response_node, status=Run.STATUS.scheduled)
def setup_responses(self): DeliveryNode.objects.all().delete() MultipleChoiceQuestion.objects.all().delete() from eums.fixtures.end_user_questions import seed_questions questions, options = seed_questions() po_item = PurchaseOrderItemFactory(quantity=100, value=1000) end_user_node_one = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, quantity=10, item=po_item, track=True) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_one, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_RECEIVED'] ) self.programme = ProgrammeFactory(name='my-program') self.ip = ConsigneeFactory() distribution_plan = DeliveryFactory(programme=self.programme, track=True) self.today = FakeDate.today() self.end_user_node_two = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, quantity=20, item=po_item, distribution_plan=distribution_plan, track=True) MultipleChoiceAnswerFactory( run=RunFactory(runnable=self.end_user_node_two, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_RECEIVED'] ) end_user_node_three = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, quantity=30, item=po_item, distribution_plan=distribution_plan, ip=self.ip, consignee=self.ip, delivery_date=self.today + datetime.timedelta(days=3), track=True) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_three, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED'] ) end_user_node_four = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, quantity=40, item=po_item, track=True) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_four, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED'] ) end_user_node_five = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, quantity=50, item=po_item, track=True) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_five, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED'] ) non_response_node = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, track=True, quantity=60, item=po_item) RunFactory(runnable=non_response_node, status=Run.STATUS.scheduled)
def setup_responses(cls): DeliveryNode.objects.all().delete() MultipleChoiceQuestion.objects.all().delete() from eums.fixtures.end_user_questions import seed_questions questions, options = seed_questions() po_item = PurchaseOrderItemFactory(quantity=100, value=1000) end_user_node_one = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=10, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_one, status=Run.STATUS.scheduled), question=questions['SATISFACTION_WITH_PRODUCT'], value=options['SATISFIED'] ) end_user_node_two = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=20, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_two, status=Run.STATUS.scheduled), question=questions['SATISFACTION_WITH_PRODUCT'], value=options['SATISFIED'] ) end_user_node_three = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=30, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_three, status=Run.STATUS.scheduled), question=questions['SATISFACTION_WITH_PRODUCT'], value=options['NOT_SATISFIED'] ) end_user_node_four = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=40, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_four, status=Run.STATUS.scheduled), question=questions['SATISFACTION_WITH_PRODUCT'], value=options['NOT_SATISFIED'] ) end_user_node_five = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=50, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_five, status=Run.STATUS.scheduled), question=questions['SATISFACTION_WITH_PRODUCT'], value=options['NOT_SATISFIED'] ) non_response_node = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=60, item=po_item) RunFactory(runnable=non_response_node, status=Run.STATUS.scheduled)
def setup_responses(self): DeliveryNode.objects.all().delete() MultipleChoiceQuestion.objects.all().delete() from eums.fixtures.end_user_questions import seed_questions questions, options = seed_questions() po_item = PurchaseOrderItemFactory(quantity=100, value=1000) selected_ip_root_node = DeliveryNodeFactory( quantity=1000, tree_position=DeliveryNode.IMPLEMENTING_PARTNER, consignee=self.selected_ip, distribution_plan=DeliveryFactory(track=True), track=True ) end_user_node_one = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, track=True, parents=[(selected_ip_root_node, 10)], item=po_item, ) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_one, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_RECEIVED'] ) end_user_node_two = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, track=True, parents=[(selected_ip_root_node, 30)], item=po_item, ) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_two, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED'] ) non_response_node_one = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, track=True, parents=[(selected_ip_root_node, 60)], item=po_item, ) RunFactory(runnable=non_response_node_one, status=Run.STATUS.scheduled) other_ip_root_node = DeliveryNodeFactory( quantity=1000, tree_position=DeliveryNode.IMPLEMENTING_PARTNER, consignee=self.other_ip, distribution_plan=DeliveryFactory(track=True), track=True ) end_user_node_three = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, track=True, parents=[(other_ip_root_node, 10)], item=po_item, ) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_three, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_RECEIVED'] ) end_user_node_four = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, track=True, parents=[(other_ip_root_node, 30)], item=po_item, ) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_four, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED'] ) non_response_node_two = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, track=True, parents=[(other_ip_root_node, 60)], item=po_item, ) RunFactory(runnable=non_response_node_two, status=Run.STATUS.scheduled)
def setup_responses(self): DeliveryNode.objects.all().delete() MultipleChoiceQuestion.objects.all().delete() from eums.fixtures.end_user_questions import seed_questions questions, options = seed_questions() po_item = PurchaseOrderItemFactory(quantity=100, value=1000) end_user_node_one = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=10, item=po_item, location=self.selected_location ) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_one, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_RECEIVED'] ) end_user_node_two = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=30, item=po_item, location=self.selected_location ) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_two, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED'] ) non_response_node_one = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=60, item=po_item, location=self.selected_location ) RunFactory(runnable=non_response_node_one, status=Run.STATUS.scheduled) end_user_node_three = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=10, item=po_item, location=self.other_location ) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_three, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_RECEIVED'] ) end_user_node_four = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=30, item=po_item, location=self.other_location ) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_four, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED'] ) non_response_node_two = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=60, item=po_item, location=self.other_location ) RunFactory(runnable=non_response_node_two, status=Run.STATUS.scheduled)
def setup_responses(self): DeliveryNode.objects.all().delete() MultipleChoiceQuestion.objects.all().delete() from eums.fixtures.end_user_questions import seed_questions questions, options = seed_questions() po_item = PurchaseOrderItemFactory(quantity=100, value=1000) end_user_node_one = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=10, item=po_item, location=self.selected_location) MultipleChoiceAnswerFactory(run=RunFactory( runnable=end_user_node_one, status=Run.STATUS.scheduled), question=questions['QUALITY_OF_PRODUCT'], value=options['IN_GOOD_CONDITION']) end_user_node_two = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, track=True, distribution_plan=None, quantity=30, item=po_item, location=self.selected_location) MultipleChoiceAnswerFactory(run=RunFactory( runnable=end_user_node_two, status=Run.STATUS.scheduled), question=questions['QUALITY_OF_PRODUCT'], value=options['DAMAGED']) non_response_node_one = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=60, item=po_item, location=self.selected_location) RunFactory(runnable=non_response_node_one, status=Run.STATUS.scheduled) end_user_node_three = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=10, item=po_item, location=self.other_location) MultipleChoiceAnswerFactory(run=RunFactory( runnable=end_user_node_three, status=Run.STATUS.scheduled), question=questions['QUALITY_OF_PRODUCT'], value=options['IN_GOOD_CONDITION']) end_user_node_four = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=30, item=po_item, location=self.other_location) MultipleChoiceAnswerFactory(run=RunFactory( runnable=end_user_node_four, status=Run.STATUS.scheduled), question=questions['QUALITY_OF_PRODUCT'], value=options['SUB_STANDARD']) non_response_node_two = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=60, item=po_item, location=self.other_location) RunFactory(runnable=non_response_node_two, status=Run.STATUS.scheduled)
def setup_responses(self): DeliveryNode.objects.all().delete() MultipleChoiceQuestion.objects.all().delete() from eums.fixtures.end_user_questions import seed_questions questions, options = seed_questions() self.programme = ProgrammeFactory(name='my-program') distribution_plan = DeliveryFactory(programme=self.programme, track=True, location='someLocation') item_one = ItemFactory(description='desc_one', material_code='code_one') item_two = ItemFactory(description='desc_two', material_code='code_two') item_three = ItemFactory(description='desc_three', material_code='code_three') po_item_one = PurchaseOrderItemFactory(quantity=100, value=1000, item=item_one) po_item_two = PurchaseOrderItemFactory(quantity=100, value=1000, item=item_two) po_item_three = PurchaseOrderItemFactory(quantity=100, value=1000, item=item_three) end_user_node_one = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, quantity=6, location='someLocation', distribution_plan=distribution_plan, item=po_item_one, track=True) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_one, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_RECEIVED'] ) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_one, status=Run.STATUS.scheduled), question=questions['QUALITY_OF_PRODUCT'], value=options['DAMAGED'] ) NumericAnswerFactory( run=RunFactory(runnable=end_user_node_one, status=Run.STATUS.scheduled), question=questions['AMOUNT_RECEIVED'], value=4 ) self.ip = ConsigneeFactory() self.today = FakeDate.today() self.end_user_node_two = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, quantity=9, location='someLocation', track=True, item=po_item_two, distribution_plan=distribution_plan) MultipleChoiceAnswerFactory( run=RunFactory(runnable=self.end_user_node_two, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED'] ) end_user_node_three = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, quantity=10, item=po_item_three, location='someLocation', distribution_plan=distribution_plan, ip=self.ip, track=True, consignee=self.ip, delivery_date=self.today + datetime.timedelta(days=3)) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_three, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED'] ) end_user_node_four = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, quantity=40, item=po_item_one, track=True) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_four, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED'] ) end_user_node_five = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, quantity=50, item=po_item_one, track=True) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_five, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED'] ) non_response_node = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, track=True, quantity=60, item=po_item_one) RunFactory(runnable=non_response_node, status=Run.STATUS.scheduled)
def setup_responses(cls): DeliveryNode.objects.all().delete() MultipleChoiceQuestion.objects.all().delete() from eums.fixtures.end_user_questions import seed_questions questions, options = seed_questions() po_item = PurchaseOrderItemFactory(quantity=100, value=1000) end_user_node_one = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=10, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_one, status=Run.STATUS.scheduled), question=questions['SATISFACTION_WITH_PRODUCT'], value=options['SATISFIED']) end_user_node_two = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=20, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_two, status=Run.STATUS.scheduled), question=questions['SATISFACTION_WITH_PRODUCT'], value=options['SATISFIED']) end_user_node_three = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=30, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_three, status=Run.STATUS.scheduled), question=questions['SATISFACTION_WITH_PRODUCT'], value=options['NOT_SATISFIED']) end_user_node_four = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=40, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_four, status=Run.STATUS.scheduled), question=questions['SATISFACTION_WITH_PRODUCT'], value=options['NOT_SATISFIED']) end_user_node_five = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=50, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_five, status=Run.STATUS.scheduled), question=questions['SATISFACTION_WITH_PRODUCT'], value=options['NOT_SATISFIED']) non_response_node = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=60, item=po_item) RunFactory(runnable=non_response_node, status=Run.STATUS.scheduled)
def setup_responses(self): DeliveryNode.objects.all().delete() MultipleChoiceQuestion.objects.all().delete() from eums.fixtures.end_user_questions import seed_questions questions, options = seed_questions() self.programme = ProgrammeFactory(name='my-program') distribution_plan = DeliveryFactory(programme=self.programme, track=True, location='someLocation') item_one = ItemFactory(description='desc_one', material_code='code_one') item_two = ItemFactory(description='desc_two', material_code='code_two') item_three = ItemFactory(description='desc_three', material_code='code_three') po_item_one = PurchaseOrderItemFactory(quantity=100, value=1000, item=item_one) po_item_two = PurchaseOrderItemFactory(quantity=100, value=1000, item=item_two) po_item_three = PurchaseOrderItemFactory(quantity=100, value=1000, item=item_three) end_user_node_one = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, quantity=6, location='someLocation', distribution_plan=distribution_plan, item=po_item_one) MultipleChoiceAnswerFactory(run=RunFactory( runnable=end_user_node_one, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_RECEIVED']) MultipleChoiceAnswerFactory(run=RunFactory( runnable=end_user_node_one, status=Run.STATUS.scheduled), question=questions['QUALITY_OF_PRODUCT'], value=options['DAMAGED']) NumericAnswerFactory(run=RunFactory(runnable=end_user_node_one, status=Run.STATUS.scheduled), question=questions['AMOUNT_RECEIVED'], value=4) self.ip = ConsigneeFactory() self.today = FakeDate.today() self.end_user_node_two = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, quantity=9, location='someLocation', item=po_item_two, distribution_plan=distribution_plan) MultipleChoiceAnswerFactory(run=RunFactory( runnable=self.end_user_node_two, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED']) end_user_node_three = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, quantity=10, item=po_item_three, location='someLocation', distribution_plan=distribution_plan, ip=self.ip, consignee=self.ip, delivery_date=self.today + datetime.timedelta(days=3)) MultipleChoiceAnswerFactory(run=RunFactory( runnable=end_user_node_three, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED']) end_user_node_four = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, quantity=40, item=po_item_one) MultipleChoiceAnswerFactory(run=RunFactory( runnable=end_user_node_four, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED']) end_user_node_five = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, quantity=50, item=po_item_one) MultipleChoiceAnswerFactory(run=RunFactory( runnable=end_user_node_five, status=Run.STATUS.scheduled), question=questions['WAS_PRODUCT_RECEIVED'], value=options['PRODUCT_WAS_NOT_RECEIVED']) non_response_node = DeliveryNodeFactory( tree_position=DeliveryNode.END_USER, track=True, quantity=60, item=po_item_one) RunFactory(runnable=non_response_node, status=Run.STATUS.scheduled)
def setup_responses(cls): DeliveryNode.objects.all().delete() MultipleChoiceQuestion.objects.all().delete() from eums.fixtures.end_user_questions import seed_questions questions, options = seed_questions() po_item = PurchaseOrderItemFactory(quantity=100, value=1000) end_user_node_one = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=10, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_one, status=Run.STATUS.scheduled), question=questions['QUALITY_OF_PRODUCT'], value=options['IN_GOOD_CONDITION'] ) end_user_node_two = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=20, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_two, status=Run.STATUS.scheduled), question=questions['QUALITY_OF_PRODUCT'], value=options['IN_GOOD_CONDITION'] ) end_user_node_three = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=30, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_three, status=Run.STATUS.scheduled), question=questions['QUALITY_OF_PRODUCT'], value=options['DAMAGED'] ) end_user_node_four = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=40, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_four, status=Run.STATUS.scheduled), question=questions['QUALITY_OF_PRODUCT'], value=options['SUB_STANDARD'] ) end_user_node_five = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=40, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_five, status=Run.STATUS.scheduled), question=questions['QUALITY_OF_PRODUCT'], value=options['EXPIRED'] ) end_user_node_six = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=10, item=po_item) MultipleChoiceAnswerFactory( run=RunFactory(runnable=end_user_node_six, status=Run.STATUS.scheduled), question=questions['QUALITY_OF_PRODUCT'], value=options['INCOMPLETE'] ) non_response_node = DeliveryNodeFactory(tree_position=DeliveryNode.END_USER, distribution_plan=None, track=True, quantity=60, item=po_item) RunFactory(runnable=non_response_node, status=Run.STATUS.scheduled)