cubicweb/server/test/unittest_migractions.py
changeset 11929 fcbd6b251d81
parent 11899 bf6106b91633
parent 11904 e760c54490b1
child 12237 2dd0dcb2e5f9
--- a/cubicweb/server/test/unittest_migractions.py	Mon Jan 23 15:35:19 2017 +0100
+++ b/cubicweb/server/test/unittest_migractions.py	Fri Jan 27 16:26:09 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.
@@ -326,6 +326,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: