cubicweb/test/unittest_schema.py
changeset 11279 e4f11ef1face
parent 11261 9e926f2dc84d
parent 11269 73ac69970047
child 11348 70337ad23145
equal deleted inserted replaced
11277:baed516c6f6e 11279:e4f11ef1face
   176                              'Usine',
   176                              'Usine',
   177                              'Workflow', 'WorkflowTransition']
   177                              'Workflow', 'WorkflowTransition']
   178         self.assertListEqual(sorted(expected_entities), entities)
   178         self.assertListEqual(sorted(expected_entities), entities)
   179         relations = sorted([str(r) for r in schema.relations()])
   179         relations = sorted([str(r) for r in schema.relations()])
   180         expected_relations = ['actionnaire', 'add_permission', 'address', 'alias', 'allowed_transition', 'associe',
   180         expected_relations = ['actionnaire', 'add_permission', 'address', 'alias', 'allowed_transition', 'associe',
   181                               'bookmarked_by', 'by_transition',
   181                               'bookmarked_by', 'by_transition', 'buddies',
   182 
   182 
   183                               'cardinality', 'comment', 'comment_format',
   183                               'cardinality', 'comment', 'comment_format',
   184                               'composite', 'condition', 'config', 'connait',
   184                               'composite', 'condition', 'config', 'connait',
   185                               'constrained_by', 'constraint_of',
   185                               'constrained_by', 'constraint_of',
   186                               'content', 'content_format', 'contrat_exclusif',
   186                               'content', 'content_format', 'contrat_exclusif',
   223 
   223 
   224         self.assertListEqual(sorted(expected_relations), relations)
   224         self.assertListEqual(sorted(expected_relations), relations)
   225 
   225 
   226         eschema = schema.eschema('CWUser')
   226         eschema = schema.eschema('CWUser')
   227         rels = sorted(str(r) for r in eschema.subject_relations())
   227         rels = sorted(str(r) for r in eschema.subject_relations())
   228         self.assertListEqual(rels, ['created_by', 'creation_date', 'custom_workflow',
   228         self.assertListEqual(rels, ['buddies', 'created_by', 'creation_date', 'custom_workflow',
   229                                     'cw_source', 'cwuri', 'eid',
   229                                     'cw_source', 'cwuri', 'eid',
   230                                     'evaluee', 'firstname', 'has_group_permission',
   230                                     'evaluee', 'firstname', 'has_group_permission',
   231                                     'has_text', 'identity',
   231                                     'has_text', 'identity',
   232                                     'in_group', 'in_state', 'is',
   232                                     'in_group', 'in_state', 'is',
   233                                     'is_instance_of', 'last_login_time',
   233                                     'is_instance_of', 'last_login_time',
   234                                     'login', 'modification_date', 'owned_by',
   234                                     'login', 'modification_date', 'owned_by',
   235                                     'primary_email', 'surname', 'upassword',
   235                                     'primary_email', 'surname', 'upassword',
   236                                     'use_email'])
   236                                     'use_email'])
   237         rels = sorted(r.type for r in eschema.object_relations())
   237         rels = sorted(r.type for r in eschema.object_relations())
   238         self.assertListEqual(rels, ['bookmarked_by', 'created_by', 'for_user',
   238         self.assertListEqual(rels, ['bookmarked_by', 'buddies', 'created_by', 'for_user',
   239                                      'identity', 'owned_by', 'wf_info_for'])
   239                                      'identity', 'owned_by', 'wf_info_for'])
   240         rschema = schema.rschema('relation_type')
   240         rschema = schema.rschema('relation_type')
   241         properties = rschema.rdef('CWAttribute', 'CWRType')
   241         properties = rschema.rdef('CWAttribute', 'CWRType')
   242         self.assertEqual(properties.cardinality, '1*')
   242         self.assertEqual(properties.cardinality, '1*')
   243         constraints = properties.constraints
   243         constraints = properties.constraints