示例#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 test_checkoff_req_post_returns_200(self):
        self.client.login(username=self.officer.username,
                          password=self.password)

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

        data = {
            "logistics_id": logistics.id,
            "type": "misc_req",
            "obj_title": misc_req.title,
            "user_id": self.candidate.id,
            "operation": "0",
        }
        response = self.client.post(reverse("candidate:checkoff_req"),
                                    data=data)

        self.client.logout()

        self.assertEqual(response.status_code, 200)
示例#3
0
 def test_str(self):
     str(ModelFactory.create_default_event_req())
     str(ModelFactory.create_form_req())
     str(ModelFactory.create_misc_req())