test/unittest_security.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 24 Jun 2009 15:26:32 +0200
changeset 34 8f2eff358816
parent 17 ca5839227688
child 90 039463d73a6e
permissions -rw-r--r--
needs to specify which entity types can be classified

from cubicweb.devtools.apptest import EnvBasedTC

class SecurityTC(EnvBasedTC):

    def setup_database(self):
        self.execute('INSERT Classification C: C name "classif1", C classifies ET WHERE ET name "CWGroup"')
        self.kw1 = self.execute('INSERT Keyword K: K name "kwgroup", K included_in C WHERE C name "classif1"')[0][0]

    def test_nonregr_keyword_selection_as_guest(self):
        self.login('anon')
        self.execute('Any X ORDERBY Z WHERE X modification_date Z, E eid %(e)s, E applied_to X', {'e':self.kw1}, 'e')

if __name__ == '__main__':
    from logilab.common.testlib import unittest_main
    unittest_main()