Exemplo n.º 1
0
 def test_by_reporting_org_ref(self):
     budget_in = fac.BudgetFactory.create(
         activity=fac.ActivityFactory.build(reporting_org__ref=u"AAA"))
     budget_not = fac.BudgetFactory.create(
         activity=fac.ActivityFactory.build(reporting_org__ref=u"ZZZ"))
     budgets = dsfilter.budgets({"reporting-org": u"AAA"})
     self.assertIn(budget_in, budgets.all())
     self.assertNotIn(budget_not, budgets.all())
Exemplo n.º 2
0
 def test_by_reporting_org_ref(self):
     budget_in = fac.BudgetFactory.create(
         activity=fac.ActivityFactory.build(reporting_org__ref=u"AAA"))
     budget_not = fac.BudgetFactory.create(
         activity=fac.ActivityFactory.build(reporting_org__ref=u"ZZZ"))
     budgets = dsfilter.budgets({
         "reporting-org": u"AAA"
     })
     self.assertIn(budget_in, budgets.all())
     self.assertNotIn(budget_not, budgets.all())
Exemplo n.º 3
0
    def test_by_participating_org_ref(self):
        budget_in = fac.BudgetFactory.create(
            activity=fac.ActivityFactory.build(participating_orgs=[
                fac.ParticipationFactory.build(organisation__ref=u"AAA")
            ]))
        budget_not = fac.BudgetFactory.create(
            activity=fac.ActivityFactory.build(participating_orgs=[
                fac.ParticipationFactory.build(organisation__ref=u"ZZZ")
            ]))

        budgets = dsfilter.budgets({"participating-org": u"AAA"})
        self.assertIn(budget_in, budgets.all())
        self.assertNotIn(budget_not, budgets.all())
Exemplo n.º 4
0
 def test_by_country_code(self):
     budget_in = fac.BudgetFactory.create(
         activity=fac.ActivityFactory.build(recipient_country_percentages=[
             fac.CountryPercentageFactory.build(country=cl.Country.libya),
         ]))
     budget_not = fac.BudgetFactory.create(
         activity=fac.ActivityFactory.build(recipient_country_percentages=[
             fac.CountryPercentageFactory.build(country=cl.Country.zambia),
         ]))
     budgets = dsfilter.budgets(
         {"recipient-country": cl.Country.from_string(u"LY")})
     self.assertIn(budget_in, budgets.all())
     self.assertNotIn(budget_not, budgets.all())
Exemplo n.º 5
0
    def test_by_participating_org_ref(self):
        budget_in = fac.BudgetFactory.create(
            activity=fac.ActivityFactory.build(
                participating_orgs=[
                    fac.ParticipationFactory.build(
                        organisation__ref=u"AAA")
                ]))
        budget_not = fac.BudgetFactory.create(
            activity=fac.ActivityFactory.build(
                participating_orgs=[
                    fac.ParticipationFactory.build(
                        organisation__ref=u"ZZZ")
                ]))

        budgets = dsfilter.budgets({
            "participating-org": u"AAA"
        })
        self.assertIn(budget_in, budgets.all())
        self.assertNotIn(budget_not, budgets.all())
Exemplo n.º 6
0
 def test_by_country_code(self):
     budget_in = fac.BudgetFactory.create(
         activity=fac.ActivityFactory.build(
             recipient_country_percentages=[
                 fac.CountryPercentageFactory.build(
                     country=cl.Country.libyan_arab_jamahiriya),
             ])
     )
     budget_not = fac.BudgetFactory.create(
         activity=fac.ActivityFactory.build(
             recipient_country_percentages=[
                 fac.CountryPercentageFactory.build(
                     country=cl.Country.zambia),
             ])
     )
     budgets = dsfilter.budgets({
         "recipient-country": cl.Country.from_string(u"LY")
     })
     self.assertIn(budget_in, budgets.all())
     self.assertNotIn(budget_not, budgets.all())