[test] simplify setup of sobjects/test/unittest_supervising.py
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 04 Apr 2014 17:56:00 +0200
changeset 9744 4693bf7ffb68
parent 9743 2bd234de9ff3
child 9745 c013d5d76f66
[test] simplify setup of sobjects/test/unittest_supervising.py
sobjects/test/unittest_supervising.py
--- a/sobjects/test/unittest_supervising.py	Fri Apr 04 17:54:29 2014 +0200
+++ b/sobjects/test/unittest_supervising.py	Fri Apr 04 17:56:00 2014 +0200
@@ -29,10 +29,9 @@
     def setup_database(self):
         with self.admin_access.client_cnx() as cnx:
             cnx.create_entity('Card', title=u"une news !", content=u"cubicweb c'est beau")
-            cnx.create_entity('Card', title=u"une autre news !", content=u"cubicweb c'est beau")
+            card = cnx.create_entity('Card', title=u"une autre news !", content=u"cubicweb c'est beau")
             cnx.create_entity('Bookmark', title=u"un signet !", path=u"view?vid=index")
-            cnx.create_entity('Comment', content=u"Yo !")
-            cnx.execute('SET C comments B WHERE B title "une autre news !", C content "Yo !"')
+            cnx.create_entity('Comment', content=u"Yo !", comments=card)
             cnx.commit()
         self.vreg.config.global_set_option('supervising-addrs', 'test@logilab.fr')