示例#1
0
    def testReportExclusion(self):
        now = datetime.utcnow()
        self.assertEqual(1, len(list(delivery.get_facility_people(now))))

        # reports for a different type shouldn't update status
        script = """
            778 > nimetuma
        """
        self.assertEqual(1, len(list(delivery.get_facility_people(now))))

        script = """
            778 > nimepokea
        """
        self.runScript(script)
        self.assertEqual(0, len(list(delivery.get_facility_people(now))))
        self.assertEqual(1, len(list(delivery.get_facility_people(datetime.utcnow()))))
示例#2
0
    def testReportExclusion(self):
        now = datetime.utcnow()
        self.assertEqual(1, len(list(delivery.get_facility_people(now))))

        # reports for a different type shouldn't update status
        script = """
            778 > nimetuma
        """
        self.assertEqual(1, len(list(delivery.get_facility_people(now))))

        script = """
            778 > nimepokea
        """
        self.runScript(script)
        self.assertEqual(0, len(list(delivery.get_facility_people(now))))
        self.assertEqual(
            1, len(list(delivery.get_facility_people(datetime.utcnow()))))
示例#3
0
    def testGroupExclusion(self):
        people = list(delivery.get_facility_people(datetime.utcnow()))
        self.assertEqual(1, len(people))
        for person in people:
            self.assertEqual(self.contact, person)

        sp = self.contact.supply_point
        sp.groups = (SupplyPointGroup.objects.get\
                     (code=DeliveryGroups().current_submitting_group()),)
        sp.save()
        people = list(delivery.get_facility_people(datetime.utcnow()))
        self.assertEqual(0, len(people))

        sp = self.contact.supply_point
        sp.groups = (SupplyPointGroup.objects.get\
                     (code=DeliveryGroups().current_processing_group()),)
        sp.save()
        people = list(delivery.get_facility_people(datetime.utcnow()))
        self.assertEqual(0, len(people))
示例#4
0
    def testGroupExclusion(self):
        people = list(delivery.get_facility_people(datetime.utcnow()))
        self.assertEqual(1, len(people))
        for person in people:
            self.assertEqual(self.contact, person)

        sp = self.contact.supply_point
        sp.groups = (SupplyPointGroup.objects.get\
                     (code=DeliveryGroups().current_submitting_group()),)
        sp.save()
        people = list(delivery.get_facility_people(datetime.utcnow()))
        self.assertEqual(0, len(people))

        sp = self.contact.supply_point
        sp.groups = (SupplyPointGroup.objects.get\
                     (code=DeliveryGroups().current_processing_group()),)
        sp.save()
        people = list(delivery.get_facility_people(datetime.utcnow()))
        self.assertEqual(0, len(people))