Exemplo n.º 1
0
 def setUp(self):
     """
     Make a draft message using an L{xquotient.iquotient.IMessageData} with
     a bunch of related addresses
     """
     self.store = Store()
     self.messageData = DummyMessageImplWithABunchOfAddresses(
         store=self.store)
     self.message = Message.createDraft(self.store, self.messageData,
                                        u'test')
Exemplo n.º 2
0
class DraftCorrespondentTestCase(TestCase):
    """
    Test that L{xquotient.exmess.Correspondent} items are created for the
    related addresses of draft messages at creation time
    """
    def setUp(self):
        """
        Make a draft message using an L{xquotient.iquotient.IMessageData} with
        a bunch of related addresses
        """
        self.store = Store()
        self.messageData = DummyMessageImplWithABunchOfAddresses(
            store=self.store)
        self.message = Message.createDraft(self.store, self.messageData,
                                           u'test')

    def test_correspondents(self):
        """
        Test that the correspondent items in the store match the related
        addresses of our L{xquotient.iquotient.IMessageData}
        """
        for (rel, addr) in self.messageData.relatedAddresses():
            self.assertEqual(
                self.store.query(
                    Correspondent,
                    AND(Correspondent.relation == rel,
                        Correspondent.address == addr.email,
                        Correspondent.message == self.message)).count(), 1,
                'no Correspondent for rel %r with addr %r' % (rel, addr.email))
Exemplo n.º 3
0
    def setUp(self):
        # XXX Incorrect setup.  See xquotient.test.test_compose.CompositionTestMixin
        self.store = Store(self.mktemp())

        LoginMethod(store=self.store,
                    internal=False,
                    protocol=u'email',
                    localpart=u'recipient',
                    domain=u'host',
                    verified=True,
                    account=self.store)

        self.fromAddr = smtpout.FromAddress(address=u'recipient@host',
                                            store=self.store)
        self.inbox = inbox.Inbox(store=self.store)
        installOn(self.inbox, self.store)
        self.composer = compose.Composer(store=self.store)
        installOn(self.composer, self.store)
        self.defaultFromAddress = self.store.findUnique(
            smtpout.FromAddress, smtpout.FromAddress._address == None)

        self.message = testMessageFactory(
            store=self.store,
            spam=False,
            impl=DummyMessageImplWithABunchOfAddresses(store=self.store))
        self.messageDetail = MessageDetail(self.message)
Exemplo n.º 4
0
class DraftCorrespondentTestCase(TestCase):
    """
    Test that L{xquotient.exmess.Correspondent} items are created for the
    related addresses of draft messages at creation time
    """
    def setUp(self):
        """
        Make a draft message using an L{xquotient.iquotient.IMessageData} with
        a bunch of related addresses
        """
        self.store = Store()
        self.messageData = DummyMessageImplWithABunchOfAddresses(
            store=self.store)
        self.message = Message.createDraft(
            self.store, self.messageData, u'test')

    def test_correspondents(self):
        """
        Test that the correspondent items in the store match the related
        addresses of our L{xquotient.iquotient.IMessageData}
        """
        for (rel, addr) in self.messageData.relatedAddresses():
            self.assertEqual(
                self.store.query(
                    Correspondent,
                    AND(Correspondent.relation == rel,
                        Correspondent.address == addr.email,
                        Correspondent.message == self.message)).count(), 1,
                'no Correspondent for rel %r with addr %r' % (rel, addr.email))
Exemplo n.º 5
0
 def setUp(self):
     """
     Make a draft message using an L{xquotient.iquotient.IMessageData} with
     a bunch of related addresses
     """
     self.store = Store()
     self.messageData = DummyMessageImplWithABunchOfAddresses(
         store=self.store)
     self.message = Message.createDraft(
         self.store, self.messageData, u'test')
Exemplo n.º 6
0
    def setUp(self):
        self.store = Store(dbdir=self.mktemp())

        installOn(inbox.Inbox(store=self.store), self.store)
        self.composer = compose.Composer(store=self.store)
        installOn(self.composer, self.store)

        LoginMethod(store=self.store,
                    internal=False,
                    protocol=u'email',
                    localpart=u'recipient',
                    domain=u'host',
                    verified=True,
                    account=self.store)

        self.msg = testMessageFactory(
            store=self.store,
            spam=False,
            impl=DummyMessageImplWithABunchOfAddresses(store=self.store))
        self.msgDetail = MessageDetail(self.msg)