equal
deleted
inserted
replaced
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 |
323 sorted(str(e) for e in self.schema.entities() if not e.final and e != 'Old')) |
323 sorted(str(e) for e in self.schema.entities() if not e.final and e != 'Old')) |
324 self.assertEqual(self.schema['filed_under2'].objects(), ('Folder2',)) |
324 self.assertEqual(self.schema['filed_under2'].objects(), ('Folder2',)) |
325 eschema = self.schema.eschema('Folder2') |
325 eschema = self.schema.eschema('Folder2') |
326 for cstr in eschema.rdef('name').constraints: |
326 for cstr in eschema.rdef('name').constraints: |
327 self.assertTrue(hasattr(cstr, 'eid')) |
327 self.assertTrue(hasattr(cstr, 'eid')) |
|
328 |
|
329 def test_add_entity_type_with_constraint(self): |
|
330 with self.mh() as (cnx, mh): |
|
331 mh.cmd_add_entity_type('Activity') |
|
332 constraints = self.table_constraints(mh, 'cw_Activity') |
|
333 self.assertEqual(len(constraints), 2, constraints) |
328 |
334 |
329 def test_add_cube_with_custom_final_type(self): |
335 def test_add_cube_with_custom_final_type(self): |
330 with self.mh() as (cnx, mh): |
336 with self.mh() as (cnx, mh): |
331 try: |
337 try: |
332 mh.cmd_add_cube('fakecustomtype') |
338 mh.cmd_add_cube('fakecustomtype') |