def setUp(self): super(TestSqlPermissionsAdapter, self).setUp() databasesetup.setup_database() self.adapter = SqlPermissionsAdapter(databasesetup.Permission, databasesetup.Group, databasesetup.DBSession) # The members of "nopermissions" are determined dynamically via a # property on the group object: self.all_sections['nopermission'] = set()
def setUp(self): super(TestSqlGroupsAdapter, self).setUp() databasesetup.setup_database() self.adapter = SqlGroupsAdapter(databasesetup.Group, databasesetup.User, databasesetup.DBSession) # The members of "nogroup" are determined dynamically via a property # on the user object: self.all_sections['nogroup'] = set()
def setUp(self): super(TestSqlPermissionsAdapter, self).setUp() databasesetup.setup_database() self.adapter = SqlPermissionsAdapter(databasesetup.Permission, databasesetup.Group, databasesetup.DBSession)
def setUp(self): super(TestSqlGroupsAdapter, self).setUp() databasesetup.setup_database() self.adapter = SqlGroupsAdapter(databasesetup.Group, databasesetup.User, databasesetup.DBSession)
from pylons.controllers.util import Request, Response from tg.controllers import TGController from pylons.testutil import ControllerWrap, SetupCacheGlobal #import pylons.tests from beaker.middleware import CacheMiddleware from model import * import databasesetup from tg.ext.repoze.who.middleware import make_who_middleware from pylons import config data_dir = os.path.dirname(os.path.abspath(__file__)) session_dir = os.path.join(data_dir, 'session') databasesetup.setup_database() session = databasesetup.session Session = databasesetup.Session def setup_session_dir(): if not os.path.exists(session_dir): os.makedirs(session_dir) def teardown_session_dir(): shutil.rmtree(session_dir, ignore_errors=True) default_environ = { 'pylons.use_webob' : True, 'pylons.routes_dict': dict(action='index'), 'paste.config': dict(global_conf=dict(debug=True)) }