예제 #1
0
 def test_extension_officer_get_new_markets(self):
     officer = utils.create_extension_officer()
     login = self.client.login(username=officer.actor.user.username,
                               password=utils.PASSWORD)
     self.assertTrue(login)
     response = self.client.get(reverse('fncs:market_new'), follow=True)
     self.assertEqual(response.request.get("PATH_INFO"), reverse('fncs:market_new'))
예제 #2
0
    def setUp(self):
        self.province = utils.create_province('test province')
        self.district = utils.create_district('test district', self.province)
        self.ward = utils.create_ward('test ward', self.district)
        self.market = utils.create_market('test market', self.district)

        self.officer = utils.create_extension_officer()
        self.client.login(username=self.officer.actor.user.username, password=utils.PASSWORD)
예제 #3
0
    def test_login_extension_officer(self):
        officer = utils.create_extension_officer()
        login = self.client.login(username=officer.actor.user.username,
                                  password=utils.PASSWORD)
        self.assertTrue(login)

        response = self.client.get(reverse('fncs:home'))
        self.assertTrue(response.context["user"].actor.is_extensionofficer())
예제 #4
0
 def setUp(self):
     self.client.login(username="******", password="******")
     self.user = User.objects.get(username="******")
     self.actor = self.user.get_profile()
     self.agent = self.actor.as_agent()
     self.officer = utils.create_extension_officer()
     self.crop = Crop.objects.get(name="Coffee")
     self.district = District.objects.get(name="Kafue")
     self.district_2 = District.objects.get(name="Nchelenge")
예제 #5
0
    def setUp(self):
        self.province = utils.create_province('test province')
        self.district = utils.create_district('test district', self.province)
        self.ward = utils.create_ward('test ward', self.district)
        self.market = utils.create_market('test market', self.district)

        self.agent = utils.create_agent()

        self.farmers = list(create_random_farmers(10, self.agent, self.market))
        self.farmer = self.farmers[0]

        self.officer = utils.create_extension_officer()
        self.client.login(username=self.officer.actor.user.username, password=utils.PASSWORD)