server/test/unittest_undo.py
changeset 10207 5ec5d17b5e5b
parent 10000 4352b7ccde04
child 10210 633d85ba9f72
--- a/server/test/unittest_undo.py	Fri Jan 16 10:56:30 2015 +0100
+++ b/server/test/unittest_undo.py	Fri Jan 16 11:17:53 2015 +0100
@@ -375,6 +375,17 @@
             p.cw_clear_all_caches()
             self.assertFalse(p.fiche)
 
+    def test_undo_inline_rel_delete_ko(self):
+        with self.admin_access.client_cnx() as cnx:
+            c = cnx.create_entity('Card', title=u'hop', content=u'hop')
+            txuuid = cnx.commit()
+            p = cnx.create_entity('Personne', nom=u'louis', fiche=c)
+            cnx.commit()
+            integrityerror = self.repo.sources_by_uri['system'].dbhelper.dbapi_module.IntegrityError
+            with self.assertRaises(integrityerror):
+                cnx.undo_transaction(txuuid)
+
+
     def test_undo_inline_rel_add_ko(self):
         """Undo add relation  Personne (?) fiche (?) Card