Exemplo n.º 1
0
    def wb_retrive_tip_data(self):
        if not self.wb_tip_id:
            self.wb_auth_with_receipt()

        self.wb_data = yield tip.get_internaltip_wb(self.wb_tip_id)

        self.assertEqual(self.wb_data['fields'], self.submission_desc['wb_fields'])
        self.assertTrue(self.wb_data['im_whistleblower'])
        self.assertFalse(self.wb_data['im_receiver'])
Exemplo n.º 2
0
    def test_access_from_receipt(self):
        submission_desc = dict(self.dummySubmission)
        submission_desc["finalize"] = True
        del submission_desc["submission_gus"]

        status = yield submission.create_submission(submission_desc, finalize=True)
        receipt = yield submission.create_whistleblower_tip(status)

        wb_access_id = yield authentication.login_wb(receipt)

        # remind: return a tuple (serzialized_itip, wb_itip)
        wb_tip = yield tip.get_internaltip_wb(wb_access_id)

        # In the WB/Receiver Tip interface, wb_fields are called fields.
        # This can be uniformed when API would be cleaned of the _gus
        self.assertTrue(wb_tip.has_key("fields"))
Exemplo n.º 3
0
    def test_update_submission(self):
        submission_desc = dict(self.dummySubmission)
        submission_desc["finalize"] = False
        submission_desc["context_gus"] = self.dummyContext["context_gus"]
        submission_desc["submission_gus"] = submission_desc["id"] = submission_desc["mark"] = None

        status = yield submission.create_submission(submission_desc, finalize=False)

        status["wb_fields"] = helpers.fill_random_fields(self.dummyContext)
        status["finalize"] = True

        status = yield submission.update_submission(status["submission_gus"], status, finalize=True)

        receipt = yield submission.create_whistleblower_tip(status)
        wb_access_id = yield authentication.login_wb(receipt)

        wb_tip = yield tip.get_internaltip_wb(wb_access_id)

        self.assertTrue(wb_tip.has_key("fields"))