def test_list_contractor_reports(self): new_report = Report( status=Report.CREATED, secondary_category=self.secondary_category, category=self.category, description="Just a test", postalcode=1000, address="my address", point=dict_to_point({"x": "149776", "y": "170005"}), address_number="6h", citizen=self.citizen, ) new_report.contractor = self.bxl new_report.save() reports = Report.objects.all() # Contractor has reports self.assertTrue(reports.entity_responsible(self.contractor))
def test_list_contractor_reports(self): new_report = Report(status=Report.CREATED, secondary_category=self.secondary_category, category=self.category, description='Just a test', postalcode=1000, address='my address', point=dict_to_point({ "x": '149776', "y": '170005' }), address_number='6h', citizen=self.citizen) new_report.contractor = self.bxl new_report.save() reports = Report.objects.all() # Contractor has reports self.assertTrue(reports.entity_responsible(self.contractor))
def test_list_contractor_manager_reports(self): new_report = Report(status=Report.CREATED, secondary_category=self.secondary_category, category=self.category, description='Just a test', postalcode=1000, address='my address', point=dict_to_point({ "x": '149776', "y": '170005' }), address_number='6h', citizen=self.citizen) new_report.contractor = self.stib new_report.responsible_department = self.group new_report.save() new_report2 = Report(status=Report.CREATED, secondary_category=self.secondary_category, category=self.category, description='Just a test', postalcode=1000, address='my address', point=dict_to_point({ "x": '149776', "y": '170005.2' }), address_number='6', citizen=self.citizen) new_report2.responsible_department = self.group new_report2.save() reports = Report.objects.all() # Entity of contractor has 2 reports self.assertEquals( 2, len(reports.entity_responsible(self.contractor_manager))) #contractor is responsible for 2 reports (1 as manager, 1 as contractor) self.assertEquals(2, len(reports.responsible(self.contractor_manager)))
def test_list_contractor_manager_reports(self): new_report = Report( status=Report.CREATED, secondary_category=self.secondary_category, category=self.category, description="Just a test", postalcode=1000, address="my address", point=dict_to_point({"x": "149776", "y": "170005"}), address_number="6h", citizen=self.citizen, ) new_report.contractor = self.stib new_report.responsible_department = self.group new_report.save() new_report2 = Report( status=Report.CREATED, secondary_category=self.secondary_category, category=self.category, description="Just a test", postalcode=1000, address="my address", point=dict_to_point({"x": "149776", "y": "170005.2"}), address_number="6", citizen=self.citizen, ) new_report2.responsible_department = self.group new_report2.save() reports = Report.objects.all() # Entity of contractor has 2 reports self.assertEquals(2, len(reports.entity_responsible(self.contractor_manager))) # contractor is responsible for 2 reports (1 as manager, 1 as contractor) self.assertEquals(2, len(reports.responsible(self.contractor_manager)))