Пример #1
0
    def test_officer_portal_with_logistics_get_returns_200(self):
        self.client.login(username=self.officer.username,
                          password=self.password)

        ModelFactory.create_bitbyteactivity_activity([self.candidate])
        ModelFactory.create_officerchallenge_activity(self.candidate,
                                                      self.officer)

        logistics = ModelFactory.create_default_logistics()
        logistics.misc_reqs.add(ModelFactory.create_misc_req())
        logistics.save()

        response = self.client.get(reverse("candidate:officer_portal"))

        self.client.logout()

        self.assertEqual(response.status_code, 200)
Пример #2
0
    def setUp(self):
        requester = ModelFactory.create_user(username="******")
        officer = ModelFactory.create_user(username="******")

        group = Group(name="officer")
        group.save()
        group.user_set.add(officer)
        group.save()

        officer_challenge = ModelFactory.create_officerchallenge_activity(
            requester, officer)

        self.requester = requester
        self.officer = officer
        self.officer_challenge = officer_challenge