cubicweb/server/test/unittest_migractions.py
branch3.24
changeset 11904 e760c54490b1
parent 11767 432f87a63057
child 11929 fcbd6b251d81
equal deleted inserted replaced
11903:6f36275a6e74 11904:e760c54490b1
     1 # copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2017 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
   310                              sorted(str(e) for e in self.schema.entities() if not e.final and e != 'Old'))
   310                              sorted(str(e) for e in self.schema.entities() if not e.final and e != 'Old'))
   311             self.assertEqual(self.schema['filed_under2'].objects(), ('Folder2',))
   311             self.assertEqual(self.schema['filed_under2'].objects(), ('Folder2',))
   312             eschema = self.schema.eschema('Folder2')
   312             eschema = self.schema.eschema('Folder2')
   313             for cstr in eschema.rdef('name').constraints:
   313             for cstr in eschema.rdef('name').constraints:
   314                 self.assertTrue(hasattr(cstr, 'eid'))
   314                 self.assertTrue(hasattr(cstr, 'eid'))
       
   315 
       
   316     def test_add_entity_type_with_constraint(self):
       
   317         with self.mh() as (cnx, mh):
       
   318             mh.cmd_add_entity_type('Activity')
       
   319             constraints = self.table_constraints(mh, 'cw_Activity')
       
   320             self.assertEqual(len(constraints), 2, constraints)
   315 
   321 
   316     def test_add_cube_with_custom_final_type(self):
   322     def test_add_cube_with_custom_final_type(self):
   317         with self.mh() as (cnx, mh):
   323         with self.mh() as (cnx, mh):
   318             try:
   324             try:
   319                 mh.cmd_add_cube('fakecustomtype')
   325                 mh.cmd_add_cube('fakecustomtype')