def test_class_answer(self):
        email_answer = EmailAnswer()
        self.assertTrue(hasattr(email_answer, 'subject'))
        self.assertTrue(hasattr(email_answer, '_content_text'))
        self.assertTrue(hasattr(email_answer, 'content_html'))
        self.assertTrue(hasattr(email_answer, 'answer_identifier'))
        self.assertTrue(hasattr(email_answer, 'email_from'))
        self.assertTrue(hasattr(email_answer, 'email_to'))
        self.assertTrue(hasattr(email_answer, 'when'))
        self.assertTrue(hasattr(email_answer, 'message_id'))
        email_answer.subject = 'prueba4'
        email_answer.content_text = 'prueba4lafieritaespeluda'
        email_answer.content_html = '<p>prueba4lafieritaespeluda</p>'
        email_answer.answer_identifier = '8974aabsdsfierapulgosa'
        email_answer.email_from = '*****@*****.**'
        email_answer.email_to = 'Felipe <*****@*****.**>'
        email_answer.when = 'Wed Jun 26 21:05:33 2013'
        email_answer.message_id = '<CAA5PczfGfdhf29wgK=8t6j7hm8HYsBy8Qg87iTU2pF42Ez3VcQ@mail.gmail.com>'

        self.assertTrue(email_answer)
        self.assertEquals(email_answer.subject, 'prueba4')
        self.assertEquals(email_answer.content_text, 'prueba4lafieritaespeluda')
        self.assertEquals(email_answer.answer_identifier, '8974aabsdsfierapulgosa')
        self.assertEquals(email_answer.email_from, '*****@*****.**')
        self.assertEquals(email_answer.email_to, 'Felipe <*****@*****.**>')
        self.assertEquals(email_answer.when, 'Wed Jun 26 21:05:33 2013')
        self.assertEquals(email_answer.message_id, '<CAA5PczfGfdhf29wgK=8t6j7hm8HYsBy8Qg87iTU2pF42Ez3VcQ@mail.gmail.com>')
        self.assertEquals(email_answer.content_html, '<p>prueba4lafieritaespeluda</p>')
 def test_it_doesnt_contain_anything_of_the_original_email(self):
     '''If I set the "To" header in the email and use it in the email_answer.recipient
     then I should not be getting her/his email address in the content'''
     email_answer = EmailAnswer()
     email_answer.subject = 'prueba5'
     email_answer.email_to = 'Tony <*****@*****.**>'
     email_answer.answer_identifier = 'identifier123'
     email_answer.content_text = (
         u'Thank you for your enquiry. I am completely in favour of this measure,\n'
         u'and will certainly be voting for it.\n'
         u'Tony \n'
         u'<*****@*****.**>:')
     # There is an intended extra space after the word 'Tony'
     self.assertNotIn('<instance-', email_answer.content_text)
     self.assertNotIn('> :', email_answer.content_text)
     self.assertNotIn('Tony', email_answer.content_text)
Exemplo n.º 3
0
 def test_it_doesnt_contain_anything_of_the_original_email(self):
     '''If I set the "To" header in the email and use it in the email_answer.recipient
     then I should not be getting her/his email address in the content'''
     email_answer = EmailAnswer()
     email_answer.subject = 'prueba5'
     email_answer.email_to = 'Tony <*****@*****.**>'
     email_answer.answer_identifier = 'identifier123'
     email_answer.content_text = (
         u'Thank you for your enquiry. I am completely in favour of this measure,\n'
         u'and will certainly be voting for it.\n'
         u'Tony \n'
         u'<*****@*****.**>:')
     # There is an intended extra space after the word 'Tony'
     self.assertNotIn('<instance-', email_answer.content_text)
     self.assertNotIn('> :', email_answer.content_text)
     self.assertNotIn('Tony', email_answer.content_text)
Exemplo n.º 4
0
    def test_class_answer(self):
        email_answer = EmailAnswer()
        self.assertTrue(hasattr(email_answer, 'subject'))
        self.assertTrue(hasattr(email_answer, '_content_text'))
        self.assertTrue(hasattr(email_answer, 'content_html'))
        self.assertTrue(hasattr(email_answer, 'answer_identifier'))
        self.assertTrue(hasattr(email_answer, 'email_from'))
        self.assertTrue(hasattr(email_answer, 'email_to'))
        self.assertTrue(hasattr(email_answer, 'when'))
        self.assertTrue(hasattr(email_answer, 'message_id'))
        email_answer.subject = 'prueba4'
        email_answer.content_text = 'prueba4lafieritaespeluda'
        email_answer.content_html = '<p>prueba4lafieritaespeluda</p>'
        email_answer.answer_identifier = '8974aabsdsfierapulgosa'
        email_answer.email_from = '*****@*****.**'
        email_answer.email_to = 'Felipe <*****@*****.**>'
        email_answer.when = 'Wed Jun 26 21:05:33 2013'
        email_answer.message_id = '<CAA5PczfGfdhf29wgK=8t6j7hm8HYsBy8Qg87iTU2pF42Ez3VcQ@mail.gmail.com>'

        self.assertTrue(email_answer)
        self.assertEquals(email_answer.subject, 'prueba4')
        self.assertEquals(email_answer.content_text,
                          'prueba4lafieritaespeluda')
        self.assertEquals(email_answer.answer_identifier,
                          '8974aabsdsfierapulgosa')
        self.assertEquals(email_answer.email_from,
                          '*****@*****.**')
        self.assertEquals(
            email_answer.email_to,
            'Felipe <*****@*****.**>')
        self.assertEquals(email_answer.when, 'Wed Jun 26 21:05:33 2013')
        self.assertEquals(
            email_answer.message_id,
            '<CAA5PczfGfdhf29wgK=8t6j7hm8HYsBy8Qg87iTU2pF42Ez3VcQ@mail.gmail.com>'
        )
        self.assertEquals(email_answer.content_html,
                          '<p>prueba4lafieritaespeluda</p>')