190 'Any X,AA,AB ORDERBY AA ASC WHERE E eid %(x)s, E evaluee X, ' |
190 'Any X,AA,AB ORDERBY AA ASC WHERE E eid %(x)s, E evaluee X, ' |
191 'X type AA, X modification_date AB') |
191 'X type AA, X modification_date AB') |
192 Personne.fetch_attrs, Personne.fetch_order = fetch_config(('nom', )) |
192 Personne.fetch_attrs, Personne.fetch_order = fetch_config(('nom', )) |
193 # XXX |
193 # XXX |
194 self.assertEquals(p.related_rql('evaluee'), |
194 self.assertEquals(p.related_rql('evaluee'), |
195 'Any X,AA ORDERBY Z DESC WHERE X modification_date Z, E eid %(x)s, E evaluee X, X modification_date AA') |
195 'Any X,AA ORDERBY Z DESC ' |
|
196 'WHERE X modification_date Z, E eid %(x)s, E evaluee X, ' |
|
197 'X modification_date AA') |
|
198 |
|
199 tag = self.vreg['etypes'].etype_class('Tag')(self.request()) |
|
200 self.assertEquals(tag.related_rql('tags', 'subject'), |
|
201 'Any X,AA ORDERBY Z DESC ' |
|
202 'WHERE X modification_date Z, E eid %(x)s, E tags X, ' |
|
203 'X modification_date AA') |
|
204 self.assertEquals(tag.related_rql('tags', 'subject', ('Personne',)), |
|
205 'Any X,AA,AB ORDERBY AA ASC ' |
|
206 'WHERE E eid %(x)s, E tags XE is IN (Personne), X nom AA, ' |
|
207 'X modification_date AB') |
196 |
208 |
197 def test_unrelated_rql_security_1(self): |
209 def test_unrelated_rql_security_1(self): |
198 user = self.request().user |
210 user = self.request().user |
199 rql = user.unrelated_rql('use_email', 'EmailAddress', 'subject')[0] |
211 rql = user.unrelated_rql('use_email', 'EmailAddress', 'subject')[0] |
200 self.assertEquals(rql, 'Any O,AA,AB,AC ORDERBY AC DESC ' |
212 self.assertEquals(rql, 'Any O,AA,AB,AC ORDERBY AC DESC ' |