[test] fix the imports stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 13 Apr 2010 17:46:17 +0200
branchstable
changeset 184 c4013c0b4b8b
parent 183 f720e4f589b0
child 188 0e9f94ed3b8c
[test] fix the imports
test/unittest_blog.py
--- a/test/unittest_blog.py	Thu Apr 01 07:38:22 2010 +0200
+++ b/test/unittest_blog.py	Tue Apr 13 17:46:17 2010 +0200
@@ -1,24 +1,20 @@
 """Blog unit tests"""
-import re
 
-from logilab.common.testlib import unittest_main, mock_object
+from logilab.common.testlib import unittest_main
 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):
     """test blog specific behaviours"""
 
     def test_notifications(self):
         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")
-        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")
-        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.commit()
         self.assertEquals(len(MAILBOX), 0)