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()
Example #3
0
 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()
Example #4
0
 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)
Example #7
0
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))
}
Example #8
0
 def setUp(self):
     super(TestSqlPermissionsAdapter, self).setUp()
     databasesetup.setup_database()
     self.adapter = SqlPermissionsAdapter(databasesetup.Permission,
                                          databasesetup.Group,
                                          databasesetup.DBSession)
Example #9
0
 def setUp(self):
     super(TestSqlGroupsAdapter, self).setUp()
     databasesetup.setup_database()
     self.adapter = SqlGroupsAdapter(databasesetup.Group,
                                     databasesetup.User,
                                     databasesetup.DBSession)