Exemple #1
0
def app():
    app = testapp()
    app.Register(mApp2)
    app.Startup(None)
    portal = Portal()
    portal.Register(app, "nive")
    return app
Exemple #2
0
 def setUp(self):
     self.app = testapp()
     self.app.Register(mApp2)
     self.app.Register(dbConfiguration2)
     self.portal = Portal()
     self.portal.Register(self.app, "nive")
     self.app.Startup(None)
Exemple #3
0
def app_db(modules=None):
    a = ApplicationBase()
    a.Register(appconf)
    if modules:
        for m in modules:
            a.Register(m)
    p = Portal()
    p.Register(a, "nive")
    a.SetupApplication()
    dbfile = DvPath(a.dbConfiguration.dbName)
    if not dbfile.IsFile():
        dbfile.CreateDirectories()
    root = DvPath(a.dbConfiguration.fileRoot)
    if not root.IsDirectory():
        root.CreateDirectories()

    try:
        a.Query("select id from pool_meta where id=1")
        a.Query("select id from data1 where id=1")
        a.Query("select id from data2 where id=1")
        a.Query("select id from data3 where id=1")
        a.Query("select id from pool_files where id=1")
        a.Query("select id from pool_sys where id=1")
        a.Query("select id from pool_groups where id=1")
        a.Query("select title from pool_meta where id=1")
    except:
        a.GetTool("nive.tools.dbStructureUpdater")()

    # disable this to update test tables each time the tests are called
    #a.GetTool("nive.tools.dbStructureUpdater")()
    a.Startup(None)
    # this will reset all testdata
    #emptypool(a)
    return a
Exemple #4
0
def app_nodb():
    a = DataStorage()
    a.Register(appconf)
    a.Register(DatabaseConf())
    p = Portal()
    p.Register(a)
    #a.Startup(None)
    return a
Exemple #5
0
def app_nodb():
    a = WebsitePublisher()
    a.Register(appconf)
    a.Register(DatabaseConf())
    p = Portal()
    p.Register(a)
    #a.Startup(None)
    return a
Exemple #6
0
def app_nodb():
    appconf = AppConf("nive.userdb.app")
    appconf.modules.append("nive.userdb.userview.view")
    appconf.modules.append("nive.components.tools.sendMail")

    a = UserDB(appconf)
    a.dbConfiguration = DatabaseConf()
    p = Portal()
    p.Register(a)
    a.Startup(None)
    return a
Exemple #7
0
def app_nodb():
    a = ApplicationBase()
    a.Register(appconf)
    a.Register(DatabaseConf())
    p = Portal()
    p.Register(a, "nive")
    a.SetupApplication()
    try:
        a.Startup(None)
    except OperationalError:
        pass
    return a
Exemple #8
0
 def setUp(self):
     request = testing.DummyRequest()
     request._LOCALE_ = "en"
     self.request = request
     self.config = testing.setUp(request=request)
     self.app = app()
     self.portal = Portal()
     self.portal.Register(self.app, "nive")
     self.app.Register("nive.cms.cmsview.view")
     self.app.Register(adminroot.configuration)
     self.app.Startup(self.config)
     self.root = self.app.root("usermanagement")
     self.request.context = self.root
Exemple #9
0
 def setUp(self):
     request = testing.DummyRequest()
     request._LOCALE_ = "en"
     self.request = request
     self.config = testing.setUp(request=request)
     self.app = app_db()
     self.portal = Portal()
     self.portal.Register(self.app, "nive")
     self.app.Register(view.configuration)
     self.app.Register(view.dbAdminConfiguration)
     self.app.Register("nive.cms.cmsview")
     self.app.Startup(self.config)
     self.request.context = self.app
Exemple #10
0
 def test_app(self):
     
     appconf = AppConf("nive.userdb.app")
     #appconf.modules.append("nive.components.extensions.sessionuser")
     
     app = UserDB(appconf)
     app.dbConfiguration=db_app.dbconf
     p = Portal()
     p.Register(app)
     app.Startup(None)
     
     self.assert_(app.usercache)
     
     self.assert_(app.root())
Exemple #11
0
 def setUp(self):
     request = testing.DummyRequest()
     request._LOCALE_ = "en"
     self.request = request
     self.request.method = "POST"
     self.config = testing.setUp(request=request)
     self.config.include('pyramid_chameleon')
     self._loadApp()
     self.portal = Portal()
     self.portal.Register(self.app, "nive")
     self.app.Register(adminroot.configuration)
     self.app.Startup(self.config)
     self.root = self.app.root("usermanagement")
     self.request.context = self.root
     self.request.content_type = ""
Exemple #12
0
def app(confs=[]):
    a = WebsitePublisher()
    a.Register(appconf)
    a.Register(dbconf)
    for c in confs:
        a.Register(c)
    p = Portal()
    p.Register(a)
    a.Startup(None)
    dbfile = DvPath(a.dbConfiguration.dbName)
    if not dbfile.IsFile():
        dbfile.CreateDirectories()
    try:
        a.Query("select id from pool_meta where id=1")
        a.Query("select id from data1 where id=1")
        a.Query("select id from data2 where id=1")
        a.Query("select id from data3 where id=1")
        a.Query("select id from pool_files where id=1")
    except:
        a.GetTool("nive.components.tools.dbStructureUpdater")()
    return a
Exemple #13
0
def app_db(confs=None):
    a = DataStorage()
    a.Register(appconf)
    if confs:
        for c in confs:
            a.Register(c)
    p = Portal()
    p.Register(a)
    a.Startup(None)
    dbfile = DvPath(a.dbConfiguration.dbName)
    if not dbfile.IsFile():
        dbfile.CreateDirectories()
    try:
        a.Query("select id from pool_meta where id=1")
        a.Query("select pool_wfp from pool_meta where id=1")
        a.Query("select id from bookmarks where id=1")
        a.Query("select id from tracks where id=1")
        a.Query("select id from pool_files where id=1")
    except:
        a.GetTool("nive.tools.dbStructureUpdater")()
    return a
Exemple #14
0
def app_db(confs=None):
    appconf = AppConf("nive_cms.app")
    a = WebsitePublisher()
    a.Register(appconf)
    if confs:
        for c in confs:
            a.Register(c)
    p = Portal()
    p.Register(a)
    a.Startup(None)
    dbfile = DvPath(a.dbConfiguration.dbName)
    if not dbfile.IsFile():
        dbfile.CreateDirectories()
    try:
        a.Query("select id from pool_meta where id=1")
        a.Query("select id from box where id=1")
        a.Query("select id from columnbox where id=1")
        a.Query("select id from texts where id=1")
        a.Query("select id from pool_files where id=1")
    except:
        a.GetTool("nive.tools.dbStructureUpdater")()
    return a
Exemple #15
0
def app(extmodules=None):
    appconf = AppConf("nive.userdb.app")
    appconf.modules.append("nive.userdb.userview.view")
    appconf.modules.append("nive.components.tools.sendMail")

    a = UserDB(appconf)
    a.dbConfiguration = dbconf
    p = Portal()
    p.Register(a)
    a.Startup(None)
    dbfile = DvPath(a.dbConfiguration.dbName)
    if not dbfile.IsFile():
        dbfile.CreateDirectories()
    try:
        a.Query("select id from pool_meta where id=1")
        a.Query("select id from data1 where id=1")
        a.Query("select id from data2 where id=1")
        a.Query("select id from data3 where id=1")
        a.Query("select id from pool_files where id=1")
    except:
        a.GetTool("nive.components.tools.dbStructureUpdater")()
    return a
Exemple #16
0
def app_db(confs=None):
    appconf = AppConf("nive_userdb.app")
    appconf.modules.append("nive_userdb.userview.view")
    appconf.modules.append("nive.tools.sendMailTester")
    a = UserDB()
    a.Register(appconf)
    if confs:
        for c in confs:
            a.Register(c)
    p = Portal()
    p.Register(a)
    a.Startup(None)
    dbfile = DvPath(a.dbConfiguration.dbName)
    if not dbfile.IsFile():
        dbfile.CreateDirectories()
    try:
        a.Query("select id from pool_meta where id=1")
        a.Query("select id from users where id=1")
        a.Query("select id from users where token='1'")
        a.Query("select id from users where tempcache='1'")
        a.Query("select id from pool_files where id=1")
    except:
        a.GetTool("nive.tools.dbStructureUpdater")()
    return a
Exemple #17
0
 def setUp(self):
     self.request = testing.DummyRequest()
     self.config = testing.setUp(request=self.request)
     self.portal = Portal()
     self.app = testapp(mApp2)
Exemple #18
0
 def setUp(self):
     self.portal = Portal()
     self.app = testapp(mApp2)