web/test/unittest_views_searchrestriction.py
changeset 10663 54b8a1f249fb
parent 10658 e73ce169762b
equal deleted inserted replaced
10662:10942ed172de 10663:54b8a1f249fb
    77     def test_nonregr2(self):
    77     def test_nonregr2(self):
    78         #'DISTINCT Any X,TMP,N WHERE P name TMP, X version_of P, P is Project, X is Version, not X in_state S,S name "published", X num N ORDERBY TMP,N'
    78         #'DISTINCT Any X,TMP,N WHERE P name TMP, X version_of P, P is Project, X is Version, not X in_state S,S name "published", X num N ORDERBY TMP,N'
    79         select = self.parse(u'DISTINCT Any V,TN,L ORDERBY TN,L WHERE T nom TN, V connait T, T is Personne, V is CWUser,'
    79         select = self.parse(u'DISTINCT Any V,TN,L ORDERBY TN,L WHERE T nom TN, V connait T, T is Personne, V is CWUser,'
    80                              'NOT V in_state VS, VS name "published", V login L')
    80                              'NOT V in_state VS, VS name "published", V login L')
    81         rschema = self.schema['connait']
    81         rschema = self.schema['connait']
    82         for rdefs in rschema.rdefs.itervalues():
    82         for rdefs in rschema.rdefs.values():
    83             rdefs.cardinality =  '++'
    83             rdefs.cardinality =  '++'
    84         try:
    84         try:
    85             self.assertEqual(self._generate(select, 'in_state', 'subject', 'name'),
    85             self.assertEqual(self._generate(select, 'in_state', 'subject', 'name'),
    86                              'DISTINCT Any A,B ORDERBY B WHERE V is CWUser, '
    86                              'DISTINCT Any A,B ORDERBY B WHERE V is CWUser, '
    87                              'NOT EXISTS(V in_state VS), VS name "published", '
    87                              'NOT EXISTS(V in_state VS), VS name "published", '
    88                              'V in_state A, A name B')
    88                              'V in_state A, A name B')
    89         finally:
    89         finally:
    90             for rdefs in rschema.rdefs.itervalues():
    90             for rdefs in rschema.rdefs.values():
    91                 rdefs.cardinality =  '**'
    91                 rdefs.cardinality =  '**'
    92 
    92 
    93     def test_nonregr3(self):
    93     def test_nonregr3(self):
    94         #'DISTINCT Any X,TMP,N WHERE P name TMP, X version_of P, P is Project, X is Version, not X in_state S,S name "published", X num N ORDERBY TMP,N'
    94         #'DISTINCT Any X,TMP,N WHERE P name TMP, X version_of P, P is Project, X is Version, not X in_state S,S name "published", X num N ORDERBY TMP,N'
    95         select = self.parse(u'DISTINCT Any X, MAX(Y) GROUPBY X WHERE X is CWUser, Y is Bookmark, X in_group A')
    95         select = self.parse(u'DISTINCT Any X, MAX(Y) GROUPBY X WHERE X is CWUser, Y is Bookmark, X in_group A')