[PATCH saem] [test/cleanup] Remove useless commit / rollback

Sylvain Thenault sylvain.thenault at logilab.fr
Fri Apr 14 10:47:26 CEST 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1492158948 -7200
#      Fri Apr 14 10:35:48 2017 +0200
# Node ID 3019df2c985307fef4158c85e50cf682c9a26191
# Parent  b2dd58f79d6e9b64d0c3a32dfc781bf39de24bef
# Available At http://hg.logilab.org/review/cubes/saem_ref
#              hg pull http://hg.logilab.org/review/cubes/saem_ref -r 3019df2c9853
[test/cleanup] Remove useless commit / rollback

this is handled by assertValidationError.

diff --git a/test/unittest_schema.py b/test/unittest_schema.py
--- a/test/unittest_schema.py
+++ b/test/unittest_schema.py
@@ -173,12 +173,11 @@ class SchemaConstraintsTC(CubicWebTC):
             jdoe.cw_set(agent_user=user)
             cnx.commit()
             # jdoe is in authority2 and attempt to set user in authority1: KO
             with self.assertValidationError(cnx):
                 user.cw_set(authority=authority1)
-                cnx.commit()
-            cnx.rollback()
+
             # break link between agent and user
             jdoe.cw_set(agent_user=None)
             cnx.commit()
             user.cw_set(authority=authority1)
             # jdoe is in authority2, user in authority1 and attempt to link them KO


More information about the saem-devel mailing list