def test_email_post(self):
     p = ProjectFactory()
     n = NodeFactory(subject="\r\n \r\n linebreaks", project=p)
     u2 = UserProfileFactory(status='active')
     p.add_manager(u2)
     p.email_post(n, "a body", n.user.userprofile)
     self.assertEqual(len(mail.outbox), 1)
Beispiel #2
0
    def test_email_reply_with_bad_header(self):
        n = NodeFactory()
        p = ProjectFactory()
        n.project = p
        u = UserProfileFactory()
        n.save()

        class DummyReply(object):
            subject = "a subject\r\nfoo"
        n.email_reply("", u, DummyReply())
        self.assertEqual(len(mail.outbox), 1)
 def test_email_reply_self_reply(self):
     n = NodeFactory()
     n.email_reply("", n.user.userprofile, None)
     # should not send an email when it's a self-reply
     self.assertEqual(len(mail.outbox), 0)
 def test_get_absolute_url(self):
     n = NodeFactory()
     self.assertEqual(n.get_absolute_url(), "/forum/%d/" % n.nid)