cubicweb/server/test/unittest_migractions.py
branch3.24
changeset 11904 e760c54490b1
parent 11767 432f87a63057
child 11929 fcbd6b251d81
--- a/cubicweb/server/test/unittest_migractions.py	Thu Jan 19 09:53:31 2017 +0100
+++ b/cubicweb/server/test/unittest_migractions.py	Wed Jan 18 15:04:27 2017 +0100
@@ -1,4 +1,4 @@
-# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2017 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -313,6 +313,12 @@
             for cstr in eschema.rdef('name').constraints:
                 self.assertTrue(hasattr(cstr, 'eid'))
 
+    def test_add_entity_type_with_constraint(self):
+        with self.mh() as (cnx, mh):
+            mh.cmd_add_entity_type('Activity')
+            constraints = self.table_constraints(mh, 'cw_Activity')
+            self.assertEqual(len(constraints), 2, constraints)
+
     def test_add_cube_with_custom_final_type(self):
         with self.mh() as (cnx, mh):
             try: