Exemplo n.º 1
0
 def test_getMessageAuthorAndSubject_multiple_From(self):
     mailin = self._makeOne()
     message = DummyMessage()
     message.from_ = ('*****@*****.**',
                      '*****@*****.**')
     info = mailin.getMessageAuthorAndSubject(message)
     self.assertEqual(info['error'], 'multiple From:')
Exemplo n.º 2
0
 def test_getMessageAuthorAndSubject_multiple_From(self):
     mailin = self._makeOne()
     message = DummyMessage()
     message.from_ = (
         '*****@*****.**',
         '*****@*****.**',
     )
     info = mailin.getMessageAuthorAndSubject(message)
     self.assertEqual(info['error'], 'multiple From:')
Exemplo n.º 3
0
    def test_getMessageAuthorAndSubject_bad_author(self):
        context = self._makeRoot()
        by_email = {}
        pf = context['profiles'] = self._makeContext()
        pf.getProfileByEmail = lambda email: by_email.get(email)
        mailin = self._makeOne(context)
        message = DummyMessage()
        message.from_ = ('*****@*****.**', )
        message.subject = 'subject'

        info = mailin.getMessageAuthorAndSubject(message)
        self.assertEqual(info['error'], 'author not found')
Exemplo n.º 4
0
    def test_getMessageAuthorAndSubject_bad_author(self):
        context = self._makeRoot()
        by_email = {}
        pf = context['profiles'] = self._makeContext()
        pf.getProfileByEmail = lambda email: by_email.get(email)
        mailin = self._makeOne(context)
        message = DummyMessage()
        message.from_ = ('*****@*****.**',)
        message.subject = 'subject'

        info = mailin.getMessageAuthorAndSubject(message)
        self.assertEqual(info['error'], 'author not found')
Exemplo n.º 5
0
    def test_getMessageAuthorAndSubject_no_subject(self):
        context = self._makeRoot()
        profile = self._makeContext()
        profile.__name__ = 'extant'
        by_email = {'*****@*****.**': profile}
        pf = context['profiles'] = self._makeContext()
        pf.getProfileByEmail = lambda email: by_email.get(email)
        mailin = self._makeOne(context)
        message = DummyMessage()
        message.from_ = ('*****@*****.**', )

        info = mailin.getMessageAuthorAndSubject(message)
        self.assertEqual(info['error'], 'missing Subject:')
Exemplo n.º 6
0
    def test_getMessageAuthorAndSubject_no_subject(self):
        context = self._makeRoot()
        profile = self._makeContext()
        profile.__name__ = 'extant'
        by_email = {'*****@*****.**': profile}
        pf = context['profiles'] = self._makeContext()
        pf.getProfileByEmail = lambda email: by_email.get(email)
        mailin = self._makeOne(context)
        message = DummyMessage()
        message.from_ = ('*****@*****.**',)

        info = mailin.getMessageAuthorAndSubject(message)
        self.assertEqual(info['error'], 'missing Subject:')
Exemplo n.º 7
0
 def test_getMessageAuthorAndSubject_no_From(self):
     mailin = self._makeOne()
     message = DummyMessage()
     info = mailin.getMessageAuthorAndSubject(message)
     self.assertEqual(info['error'], 'missing From:')
Exemplo n.º 8
0
 def test_getMessageAuthorAndSubject_no_From(self):
     mailin = self._makeOne()
     message = DummyMessage()
     info = mailin.getMessageAuthorAndSubject(message)
     self.assertEqual(info['error'], 'missing From:')