Skip to content
Snippets Groups Projects
Commit 0e9f94ed3b8c authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

merge

No related branches found
No related tags found
No related merge requests found
"""Blog unit tests""" """Blog unit tests"""
import re
...@@ -3,4 +2,4 @@ ...@@ -3,4 +2,4 @@
from logilab.common.testlib import unittest_main, mock_object from logilab.common.testlib import unittest_main
from cubicweb.devtools.testlib import CubicWebTC, MAILBOX from cubicweb.devtools.testlib import CubicWebTC, MAILBOX
...@@ -5,12 +4,8 @@ ...@@ -5,12 +4,8 @@
from cubicweb.devtools.testlib import CubicWebTC, MAILBOX from cubicweb.devtools.testlib import CubicWebTC, MAILBOX
from email.Header import decode_header
from cubicweb.sobjects.notification import RenderAndSendNotificationView
from cubicweb.server.hookhelper import SendMailOp
class BlogTestsCubicWebTC(CubicWebTC): class BlogTestsCubicWebTC(CubicWebTC):
"""test blog specific behaviours""" """test blog specific behaviours"""
def test_notifications(self): def test_notifications(self):
req = self.request() req = self.request()
...@@ -11,8 +6,9 @@ ...@@ -11,8 +6,9 @@
class BlogTestsCubicWebTC(CubicWebTC): class BlogTestsCubicWebTC(CubicWebTC):
"""test blog specific behaviours""" """test blog specific behaviours"""
def test_notifications(self): def test_notifications(self):
req = self.request() req = self.request()
cubicweb_blog = req.create_entity('Blog', title=u'cubicweb', description=u"cubicweb c'est beau") cubicweb_blog = req.create_entity('Blog', title=u'cubicweb',
description=u"cubicweb c'est beau")
blog_entry_1 = req.create_entity('BlogEntry', title=u"hop", content=u"cubicweb hop") blog_entry_1 = req.create_entity('BlogEntry', title=u"hop", content=u"cubicweb hop")
...@@ -18,3 +14,3 @@ ...@@ -18,3 +14,3 @@
blog_entry_1 = req.create_entity('BlogEntry', title=u"hop", content=u"cubicweb hop") blog_entry_1 = req.create_entity('BlogEntry', title=u"hop", content=u"cubicweb hop")
self.execute('SET E entry_of B WHERE B eid %(beid)s, E eid %(eeid)s' % {'beid' :cubicweb_blog.eid, 'eeid' : blog_entry_1.eid}) blog_entry_1.set_relations(entry_of=cubicweb_blog)
blog_entry_2 = req.create_entity('BlogEntry', title=u"yes", content=u"cubicweb yes") blog_entry_2 = req.create_entity('BlogEntry', title=u"yes", content=u"cubicweb yes")
...@@ -20,5 +16,5 @@ ...@@ -20,5 +16,5 @@
blog_entry_2 = req.create_entity('BlogEntry', title=u"yes", content=u"cubicweb yes") blog_entry_2 = req.create_entity('BlogEntry', title=u"yes", content=u"cubicweb yes")
self.execute('SET E entry_of B WHERE B eid %(beid)s, E eid %(eeid)s' % {'beid' :cubicweb_blog.eid, 'eeid' : blog_entry_2.eid}) blog_entry_2.set_relations(entry_of=cubicweb_blog)
self.assertEquals(len(MAILBOX), 0) self.assertEquals(len(MAILBOX), 0)
self.commit() self.commit()
self.assertEquals(len(MAILBOX), 0) self.assertEquals(len(MAILBOX), 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment