test/unittest_schema.py
branchtls-sprint
changeset 750 89e997bc2bf1
parent 624 258e5692ae06
child 985 6a25c58a1c23
equal deleted inserted replaced
749:c23169f79a3b 750:89e997bc2bf1
   142         expected_entities = ['Bookmark', 'Boolean', 'Bytes', 'Card', 
   142         expected_entities = ['Bookmark', 'Boolean', 'Bytes', 'Card', 
   143                              'Date', 'Datetime', 'Decimal',
   143                              'Date', 'Datetime', 'Decimal',
   144                              'ECache', 'EConstraint', 'EConstraintType', 'EEType',
   144                              'ECache', 'EConstraint', 'EConstraintType', 'EEType',
   145                              'EFRDef', 'EGroup', 'EmailAddress', 'ENFRDef',
   145                              'EFRDef', 'EGroup', 'EmailAddress', 'ENFRDef',
   146                              'EPermission', 'EProperty', 'ERType', 'EUser',
   146                              'EPermission', 'EProperty', 'ERType', 'EUser',
   147                              'Float', 'Int', 'Interval', 
   147                              'File', 'Float', 'Image', 'Int', 'Interval', 'Note',
   148                              'Password', 
   148                              'Password', 'Personne',
   149                              'RQLExpression', 
   149                              'RQLExpression', 
   150                              'State', 'String', 'Time', 
   150                              'Societe', 'State', 'String', 'SubNote', 'Tag', 'Time', 
   151                              'Transition', 'TrInfo']
   151                              'Transition', 'TrInfo']
   152         self.assertListEquals(entities, sorted(expected_entities))
   152         self.assertListEquals(entities, sorted(expected_entities))
   153         relations = [str(r) for r in schema.relations()]
   153         relations = [str(r) for r in schema.relations()]
   154         relations.sort()
   154         relations.sort()
   155         expected_relations = ['add_permission', 'address', 'alias',
   155         expected_relations = ['add_permission', 'address', 'alias',
   156                               'allowed_transition', 'bookmarked_by', 'canonical',
   156                               'allowed_transition', 'bookmarked_by', 'canonical',
   157 
   157 
   158                               'cardinality', 'comment', 'comment_format', 
   158                               'cardinality', 'comment', 'comment_format', 
   159                               'composite', 'condition', 'constrained_by', 'content',
   159                               'composite', 'condition', 'connait', 'constrained_by', 'content',
   160                               'content_format', 'created_by', 'creation_date', 'cstrtype',
   160                               'content_format', 'created_by', 'creation_date', 'cstrtype',
   161 
   161 
   162                               'defaultval', 'delete_permission', 'description',
   162                               'data', 'data_encoding', 'data_format', 'defaultval', 'delete_permission',
   163                               'description_format', 'destination_state',
   163                               'description', 'description_format', 'destination_state',
   164 
   164 
   165                               'eid', 'expression', 'exprtype',
   165                               'ecrit_par', 'eid', 'evaluee', 'expression', 'exprtype',
   166 
   166 
   167                               'final', 'firstname', 'for_user',
   167                               'final', 'firstname', 'for_user',
   168                               'from_entity', 'from_state', 'fulltext_container', 'fulltextindexed',
   168                               'from_entity', 'from_state', 'fulltext_container', 'fulltextindexed',
   169 
   169 
   170                               'has_text', 
   170                               'has_text', 
   173 
   173 
   174                               'label', 'last_login_time', 'login',
   174                               'label', 'last_login_time', 'login',
   175 
   175 
   176                               'mainvars', 'meta', 'modification_date',
   176                               'mainvars', 'meta', 'modification_date',
   177 
   177 
   178                               'name', 
   178                               'name', 'nom',
   179 
   179 
   180                               'ordernum', 'owned_by',
   180                               'ordernum', 'owned_by',
   181 
   181 
   182                               'path', 'pkey', 'primary_email', 
   182                               'path', 'pkey', 'prenom', 'primary_email', 
   183 
   183 
   184                               'read_permission', 'relation_type', 'require_group',
   184                               'read_permission', 'relation_type', 'require_group',
   185                               
   185                               
   186                               'specializes', 'state_of', 'surname', 'symetric', 'synopsis',
   186                               'specializes', 'state_of', 'surname', 'symetric', 'synopsis',
   187 
   187 
   188                               'timestamp', 'title', 'to_entity', 'to_state', 'transition_of',
   188                               'tags', 'timestamp', 'title', 'to_entity', 'to_state', 'transition_of', 'travaille', 'type',
   189 
   189 
   190                               'upassword', 'update_permission', 'use_email',
   190                               'upassword', 'update_permission', 'use_email',
   191 
   191 
   192                               'value', 
   192                               'value', 
   193 
   193 
   196         self.assertListEquals(relations, expected_relations)
   196         self.assertListEquals(relations, expected_relations)
   197 
   197 
   198         eschema = schema.eschema('EUser')
   198         eschema = schema.eschema('EUser')
   199         rels = sorted(str(r) for r in eschema.subject_relations())
   199         rels = sorted(str(r) for r in eschema.subject_relations())
   200         self.assertListEquals(rels, ['created_by', 'creation_date', 'eid',
   200         self.assertListEquals(rels, ['created_by', 'creation_date', 'eid',
   201                                      'firstname', 'has_text', 'identity',
   201                                      'evaluee', 'firstname', 'has_text', 'identity',
   202                                      'in_group', 'in_state', 'is',
   202                                      'in_group', 'in_state', 'is',
   203                                      'is_instance_of', 'last_login_time',
   203                                      'is_instance_of', 'last_login_time',
   204                                      'login', 'modification_date', 'owned_by',
   204                                      'login', 'modification_date', 'owned_by',
   205                                      'primary_email', 'surname', 'upassword',
   205                                      'primary_email', 'surname', 'upassword',
   206                                      'use_email'])
   206                                      'use_email'])