Esempio n. 1
0
    def test_prepareHeaders_nopodding_with_rewrite(self):
        """
        Make sure Originator header is properly re-written.
        """

        txn = self.transactionUnderTest()
        server = IScheduleServerRecord("https://calendar.example.com",
                                       rewriteCUAddresses=True,
                                       podding=False)
        request = IScheduleRequest(
            self.FakeScheduler(txn, "urn:x-uid:user01"),
            server,
            (CalendarUser("mailto:[email protected]"), ),
            None,
            False,
        )
        _ignore_ssl, host, port, _ignore_path = server.details()
        yield request._prepareHeaders(host, port, "VEVENT", "REQUEST")
        yield txn.commit()

        self.assertEqual(
            request.headers.getRawHeaders("Originator")[0],
            "mailto:[email protected]")
        self.assertEqual(
            request.headers.getRawHeaders("Recipient")[0],
            "mailto:[email protected]")
Esempio n. 2
0
 def __init__(self, txn, organizer, caldata=None):
     self.txn = txn
     self.organizer = CalendarUser(organizer)
     self.calendar = Component.fromString(caldata) if caldata else None
     self.isiTIPRequest = True
     self.isfreebusy = False