changeset 459:7c978511c951

implemented basic (startup) nose test suite.
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 05 Sep 2010 16:20:29 +0200
parents 00f883abdb0c
children 92cacbcb5272
files pylons_app/config/environment.py pylons_app/config/routing.py pylons_app/controllers/login.py pylons_app/lib/db_manage.py pylons_app/model/db.py pylons_app/tests/__init__.py pylons_app/tests/functional/test_admin.py pylons_app/tests/functional/test_admin_settings.py pylons_app/tests/functional/test_admin_settings_hg.py pylons_app/tests/functional/test_branches.py pylons_app/tests/functional/test_changelog.py pylons_app/tests/functional/test_changeset.py pylons_app/tests/functional/test_feed.py pylons_app/tests/functional/test_files.py pylons_app/tests/functional/test_repos.py pylons_app/tests/functional/test_settings.py pylons_app/tests/functional/test_shortlog.py pylons_app/tests/functional/test_summary.py pylons_app/tests/functional/test_tags.py pylons_app/websetup.py setup.cfg tests.ini
diffstat 22 files changed, 274 insertions(+), 112 deletions(-) [+]
line wrap: on
line diff
--- a/pylons_app/config/environment.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/config/environment.py	Sun Sep 05 16:20:29 2010 +0200
@@ -52,7 +52,7 @@
     
     #MULTIPLE DB configs
     # Setup the SQLAlchemy database engine
-    if config['debug']:
+    if config['debug'] and os.path.split(config['__file__'])[-1] != 'tests.ini':
         #use query time debugging.
         from pylons_app.lib.timerproxy import TimerProxy
         sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.',
--- a/pylons_app/config/routing.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/config/routing.py	Sun Sep 05 16:20:29 2010 +0200
@@ -71,18 +71,17 @@
     map.resource('user', 'users', controller='admin/users', path_prefix='/_admin')
     map.resource('permission', 'permissions', controller='admin/permissions', path_prefix='/_admin')
     
-    #map.resource('setting', 'settings', controller='admin/settings', path_prefix='/_admin', name_prefix='admin_')
     #REST SETTINGS MAP
     with map.submapper(path_prefix='/_admin', controller='admin/settings') as m:
         m.connect("admin_settings", "/settings",
              action="create", conditions=dict(method=["POST"]))
         m.connect("admin_settings", "/settings",
              action="index", conditions=dict(method=["GET"]))
-        m.connect("admin_formatted_settings", "/settings.{format}",
+        m.connect("formatted_admin_settings", "/settings.{format}",
              action="index", conditions=dict(method=["GET"]))
         m.connect("admin_new_setting", "/settings/new",
              action="new", conditions=dict(method=["GET"]))
-        m.connect("admin_formatted_new_setting", "/settings/new.{format}",
+        m.connect("formatted_admin_new_setting", "/settings/new.{format}",
              action="new", conditions=dict(method=["GET"]))
         m.connect("/settings/{setting_id}",
              action="update", conditions=dict(method=["PUT"]))
@@ -90,11 +89,11 @@
              action="delete", conditions=dict(method=["DELETE"]))
         m.connect("admin_edit_setting", "/settings/{setting_id}/edit",
              action="edit", conditions=dict(method=["GET"]))
-        m.connect("admin_formatted_edit_setting", "/settings/{setting_id}.{format}/edit",
+        m.connect("formatted_admin_edit_setting", "/settings/{setting_id}.{format}/edit",
              action="edit", conditions=dict(method=["GET"]))
         m.connect("admin_setting", "/settings/{setting_id}",
              action="show", conditions=dict(method=["GET"]))
-        m.connect("admin_formatted_setting", "/settings/{setting_id}.{format}",
+        m.connect("formatted_admin_setting", "/settings/{setting_id}.{format}",
              action="show", conditions=dict(method=["GET"]))
         m.connect("admin_settings_my_account", "/my_account",
              action="my_account", conditions=dict(method=["GET"]))
--- a/pylons_app/controllers/login.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/controllers/login.py	Sun Sep 05 16:20:29 2010 +0200
@@ -30,9 +30,7 @@
 from pylons_app.lib.base import BaseController, render
 from pylons_app.model.forms import LoginForm, RegisterForm
 from pylons_app.model.user_model import UserModel
-from sqlalchemy.exc import OperationalError
 import formencode
-import datetime
 import logging
 
 log = logging.getLogger(__name__)
--- a/pylons_app/lib/db_manage.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/lib/db_manage.py	Sun Sep 05 16:20:29 2010 +0200
@@ -43,8 +43,9 @@
 log = logging.getLogger(__name__)
 
 class DbManage(object):
-    def __init__(self, log_sql):
-        self.dbname = 'hg_app.db'
+    def __init__(self, log_sql, dbname,tests=False):
+        self.dbname = dbname
+        self.tests = tests
         dburi = 'sqlite:////%s' % jn(ROOT, self.dbname)
         engine = create_engine(dburi, echo=log_sql) 
         init_model(engine)
@@ -66,7 +67,10 @@
         self.check_for_db(override)
         if override:
             log.info("database exisist and it's going to be destroyed")
-            destroy = ask_ok('Are you sure to destroy old database ? [y/n]')
+            if self.tests:
+                destroy=True
+            else:
+                destroy = ask_ok('Are you sure to destroy old database ? [y/n]')
             if not destroy:
                 sys.exit()
             if self.db_exists and destroy:
@@ -76,19 +80,29 @@
         log.info('Created tables for %s', self.dbname)
     
     def admin_prompt(self):
-        import getpass
-        username = raw_input('Specify admin username:')
-        password = getpass.getpass('Specify admin password:')
-        self.create_user(username, password, True)
+        if not self.tests:
+            import getpass
+            username = raw_input('Specify admin username:')
+            password = getpass.getpass('Specify admin password:')
+            self.create_user(username, password, True)
+        else:
+            log.info('creating admin and regular test users')
+            self.create_user('test_admin', 'test', True)
+            self.create_user('test_regular', 'test', False)
+            
+        
     
-    def config_prompt(self):
+    def config_prompt(self,test_repo_path=''):
         log.info('Setting up repositories config')
         
-        path = raw_input('Specify valid full path to your repositories'
+        if not self.tests and not test_repo_path:
+            path = raw_input('Specify valid full path to your repositories'
                         ' you can change this later in application settings:')
-        
+        else:
+            path = test_repo_path
+            
         if not os.path.isdir(path):
-            log.error('You entered wrong path')
+            log.error('You entered wrong path: %s',path)
             sys.exit()
         
         hooks1 = HgAppUi()
@@ -153,18 +167,6 @@
         log.info('created ui config')
                     
     def create_user(self, username, password, admin=False):
-        
-        log.info('creating default user')
-        #create default user for handling default permissions.
-        def_user = User()
-        def_user.username = 'default'
-        def_user.password = get_crypt_password(str(uuid.uuid1())[:8])
-        def_user.name = 'default'
-        def_user.lastname = 'default'
-        def_user.email = 'default@default.com'
-        def_user.admin = False
-        def_user.active = False
-        
         log.info('creating administrator user %s', username)
         new_user = User()
         new_user.username = username
@@ -176,8 +178,25 @@
         new_user.active = True
         
         try:
+            self.sa.add(new_user)
+            self.sa.commit()
+        except:
+            self.sa.rollback()
+            raise
+
+    def create_default_user(self):
+        log.info('creating default user')
+        #create default user for handling default permissions.
+        def_user = User()
+        def_user.username = 'default'
+        def_user.password = get_crypt_password(str(uuid.uuid1())[:8])
+        def_user.name = 'default'
+        def_user.lastname = 'default'
+        def_user.email = 'default@default.com'
+        def_user.admin = False
+        def_user.active = False
+        try:
             self.sa.add(def_user)
-            self.sa.add(new_user)
             self.sa.commit()
         except:
             self.sa.rollback()
--- a/pylons_app/model/db.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/model/db.py	Sun Sep 05 16:20:29 2010 +0200
@@ -26,7 +26,7 @@
     
 class User(Base): 
     __tablename__ = 'users'
-    __table_args__ = {'useexisting':True}
+    __table_args__ = (UniqueConstraint('username'), {'useexisting':True})
     user_id = Column("user_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True)
     username = Column("username", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
     password = Column("password", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
--- a/pylons_app/tests/__init__.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/tests/__init__.py	Sun Sep 05 16:20:29 2010 +0200
@@ -14,23 +14,23 @@
 from pylons import config, url
 from routes.util import URLGenerator
 from webtest import TestApp
+import os
 
 import pylons.test
 
 __all__ = ['environ', 'url', 'TestController']
 
 # Invoke websetup with the current config file
-SetupCommand('setup-app').run([config['__file__']])
+SetupCommand('setup-app').run([pylons.test.pylonsapp.config['__file__']])
 
 environ = {}
 
 class TestController(TestCase):
 
     def __init__(self, *args, **kwargs):
-        if pylons.test.pylonsapp:
-            wsgiapp = pylons.test.pylonsapp
-        else:
-            wsgiapp = loadapp('config:%s' % config['__file__'])
+        wsgiapp = pylons.test.pylonsapp
+        config = wsgiapp.config
         self.app = TestApp(wsgiapp)
         url._push_object(URLGenerator(config['routes.map'], environ))
         TestCase.__init__(self, *args, **kwargs)
+
--- a/pylons_app/tests/functional/test_admin.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/tests/functional/test_admin.py	Sun Sep 05 16:20:29 2010 +0200
@@ -3,5 +3,5 @@
 class TestAdminController(TestController):
 
     def test_index(self):
-        response = self.app.get(url(controller='admin', action='index'))
+        response = self.app.get(url(controller='admin/admin', action='index'))
         # Test response...
--- a/pylons_app/tests/functional/test_admin_settings.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/tests/functional/test_admin_settings.py	Sun Sep 05 16:20:29 2010 +0200
@@ -19,25 +19,25 @@
         response = self.app.get(url('formatted_admin_new_setting', format='xml'))
 
     def test_update(self):
-        response = self.app.put(url('admin_setting', id=1))
+        response = self.app.put(url('admin_setting', setting_id=1))
 
     def test_update_browser_fakeout(self):
-        response = self.app.post(url('admin_setting', id=1), params=dict(_method='put'))
+        response = self.app.post(url('admin_setting', setting_id=1), params=dict(_method='put'))
 
     def test_delete(self):
-        response = self.app.delete(url('admin_setting', id=1))
+        response = self.app.delete(url('admin_setting', setting_id=1))
 
     def test_delete_browser_fakeout(self):
-        response = self.app.post(url('admin_setting', id=1), params=dict(_method='delete'))
+        response = self.app.post(url('admin_setting', setting_id=1), params=dict(_method='delete'))
 
     def test_show(self):
-        response = self.app.get(url('admin_setting', id=1))
+        response = self.app.get(url('admin_setting', setting_id=1))
 
     def test_show_as_xml(self):
-        response = self.app.get(url('formatted_admin_setting', id=1, format='xml'))
+        response = self.app.get(url('formatted_admin_setting', setting_id=1, format='xml'))
 
     def test_edit(self):
-        response = self.app.get(url('admin_edit_setting', id=1))
+        response = self.app.get(url('admin_edit_setting', setting_id=1))
 
     def test_edit_as_xml(self):
-        response = self.app.get(url('formatted_admin_edit_setting', id=1, format='xml'))
+        response = self.app.get(url('formatted_admin_edit_setting', setting_id=1, format='xml'))
--- a/pylons_app/tests/functional/test_admin_settings_hg.py	Sun Sep 05 13:55:47 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-from pylons_app.tests import *
-
-class TestSettingsHgController(TestController):
-
-    def test_index(self):
-        response = self.app.get(url('admin_settings_hg'))
-        # Test response...
-
-    def test_index_as_xml(self):
-        response = self.app.get(url('formatted_admin_settings_hg', format='xml'))
-
-    def test_create(self):
-        response = self.app.post(url('admin_settings_hg'))
-
-    def test_new(self):
-        response = self.app.get(url('admin_new_setting_hg'))
-
-    def test_new_as_xml(self):
-        response = self.app.get(url('formatted_admin_new_setting_hg', format='xml'))
-
-    def test_update(self):
-        response = self.app.put(url('admin_setting_hg', id=1))
-
-    def test_update_browser_fakeout(self):
-        response = self.app.post(url('admin_setting_hg', id=1), params=dict(_method='put'))
-
-    def test_delete(self):
-        response = self.app.delete(url('admin_setting_hg', id=1))
-
-    def test_delete_browser_fakeout(self):
-        response = self.app.post(url('admin_setting_hg', id=1), params=dict(_method='delete'))
-
-    def test_show(self):
-        response = self.app.get(url('admin_setting_hg', id=1))
-
-    def test_show_as_xml(self):
-        response = self.app.get(url('formatted_admin_setting_hg', id=1, format='xml'))
-
-    def test_edit(self):
-        response = self.app.get(url('admin_edit_setting_hg', id=1))
-
-    def test_edit_as_xml(self):
-        response = self.app.get(url('formatted_admin_edit_setting_hg', id=1, format='xml'))
--- a/pylons_app/tests/functional/test_branches.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/tests/functional/test_branches.py	Sun Sep 05 16:20:29 2010 +0200
@@ -3,5 +3,5 @@
 class TestBranchesController(TestController):
 
     def test_index(self):
-        response = self.app.get(url(controller='branches', action='index'))
+        response = self.app.get(url(controller='branches', action='index',repo_name='vcs_test'))
         # Test response...
--- a/pylons_app/tests/functional/test_changelog.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/tests/functional/test_changelog.py	Sun Sep 05 16:20:29 2010 +0200
@@ -3,5 +3,5 @@
 class TestChangelogController(TestController):
 
     def test_index(self):
-        response = self.app.get(url(controller='changelog', action='index'))
+        response = self.app.get(url(controller='changelog', action='index',repo_name='vcs_test'))
         # Test response...
--- a/pylons_app/tests/functional/test_changeset.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/tests/functional/test_changeset.py	Sun Sep 05 16:20:29 2010 +0200
@@ -3,5 +3,6 @@
 class TestChangesetController(TestController):
 
     def test_index(self):
-        response = self.app.get(url(controller='changeset', action='index'))
+        response = self.app.get(url(controller='changeset', action='index',
+                                    repo_name='vcs_test',revision='tip'))
         # Test response...
--- a/pylons_app/tests/functional/test_feed.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/tests/functional/test_feed.py	Sun Sep 05 16:20:29 2010 +0200
@@ -2,6 +2,12 @@
 
 class TestFeedController(TestController):
 
-    def test_index(self):
-        response = self.app.get(url(controller='feed', action='index'))
+    def test_rss(self):
+        response = self.app.get(url(controller='feed', action='rss',
+                                    repo_name='vcs_test'))
         # Test response...
+
+    def test_atom(self):
+        response = self.app.get(url(controller='feed', action='atom',
+                                    repo_name='vcs_test'))
+        # Test response...
\ No newline at end of file
--- a/pylons_app/tests/functional/test_files.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/tests/functional/test_files.py	Sun Sep 05 16:20:29 2010 +0200
@@ -3,5 +3,8 @@
 class TestFilesController(TestController):
 
     def test_index(self):
-        response = self.app.get(url(controller='files', action='index'))
+        response = self.app.get(url(controller='files', action='index',
+                                    repo_name='vcs_test',
+                                    revision='tip',
+                                    f_path='/'))
         # Test response...
--- a/pylons_app/tests/functional/test_repos.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/tests/functional/test_repos.py	Sun Sep 05 16:20:29 2010 +0200
@@ -19,25 +19,25 @@
         response = self.app.get(url('formatted_new_repo', format='xml'))
 
     def test_update(self):
-        response = self.app.put(url('repo', id=1))
+        response = self.app.put(url('repo', repo_name='vcs_test'))
 
     def test_update_browser_fakeout(self):
-        response = self.app.post(url('repo', id=1), params=dict(_method='put'))
+        response = self.app.post(url('repo', repo_name='vcs_test'), params=dict(_method='put'))
 
     def test_delete(self):
-        response = self.app.delete(url('repo', id=1))
+        response = self.app.delete(url('repo', repo_name='vcs_test'))
 
     def test_delete_browser_fakeout(self):
-        response = self.app.post(url('repo', id=1), params=dict(_method='delete'))
+        response = self.app.post(url('repo', repo_name='vcs_test'), params=dict(_method='delete'))
 
     def test_show(self):
-        response = self.app.get(url('repo', id=1))
+        response = self.app.get(url('repo', repo_name='vcs_test'))
 
     def test_show_as_xml(self):
-        response = self.app.get(url('formatted_repo', id=1, format='xml'))
+        response = self.app.get(url('formatted_repo', repo_name='vcs_test', format='xml'))
 
     def test_edit(self):
-        response = self.app.get(url('edit_repo', id=1))
+        response = self.app.get(url('edit_repo', repo_name='vcs_test'))
 
     def test_edit_as_xml(self):
-        response = self.app.get(url('formatted_edit_repo', id=1, format='xml'))
+        response = self.app.get(url('formatted_edit_repo', repo_name='vcs_test', format='xml'))
--- a/pylons_app/tests/functional/test_settings.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/tests/functional/test_settings.py	Sun Sep 05 16:20:29 2010 +0200
@@ -3,5 +3,6 @@
 class TestSettingsController(TestController):
 
     def test_index(self):
-        response = self.app.get(url(controller='settings', action='index'))
+        response = self.app.get(url(controller='settings', action='index',
+                                    repo_name='vcs_test'))
         # Test response...
--- a/pylons_app/tests/functional/test_shortlog.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/tests/functional/test_shortlog.py	Sun Sep 05 16:20:29 2010 +0200
@@ -3,5 +3,5 @@
 class TestShortlogController(TestController):
 
     def test_index(self):
-        response = self.app.get(url(controller='shortlog', action='index'))
+        response = self.app.get(url(controller='shortlog', action='index',repo_name='vcs_test'))
         # Test response...
--- a/pylons_app/tests/functional/test_summary.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/tests/functional/test_summary.py	Sun Sep 05 16:20:29 2010 +0200
@@ -3,5 +3,5 @@
 class TestSummaryController(TestController):
 
     def test_index(self):
-        response = self.app.get(url(controller='summary', action='index'))
+        response = self.app.get(url(controller='summary', action='index',repo_name='vcs_test'))
         # Test response...
--- a/pylons_app/tests/functional/test_tags.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/tests/functional/test_tags.py	Sun Sep 05 16:20:29 2010 +0200
@@ -3,5 +3,5 @@
 class TestTagsController(TestController):
 
     def test_index(self):
-        response = self.app.get(url(controller='tags', action='index'))
+        response = self.app.get(url(controller='tags', action='index',repo_name='vcs_test'))
         # Test response...
--- a/pylons_app/websetup.py	Sun Sep 05 13:55:47 2010 +0200
+++ b/pylons_app/websetup.py	Sun Sep 05 16:20:29 2010 +0200
@@ -3,10 +3,12 @@
 from os.path import dirname as dn, join as jn
 from pylons_app.config.environment import load_environment
 from pylons_app.lib.db_manage import DbManage
+import datetime
+from time import mktime
 import logging
 import os
 import sys
-
+import shutil
 log = logging.getLogger(__name__)
 
 ROOT = dn(dn(os.path.realpath(__file__)))
@@ -14,9 +16,27 @@
 
 def setup_app(command, conf, vars):
     """Place any commands to setup pylons_app here"""
-    dbmanage = DbManage(log_sql=True)
+    log_sql = True
+    tests = False
+    
+    dbname = os.path.split(conf['sqlalchemy.db1.url'])[-1]
+    filename = os.path.split(conf.filename)[-1]
+    
+    if filename == 'tests.ini':
+        uniq_suffix = str(int(mktime(datetime.datetime.now().timetuple())))
+        REPO_TEST_PATH = '/tmp/hg_app_test_%s' % uniq_suffix
+        
+        if not os.path.isdir(REPO_TEST_PATH):
+            os.mkdir(REPO_TEST_PATH)
+            from_ = '/home/marcink/workspace-python/vcs'
+            shutil.copytree(from_, os.path.join(REPO_TEST_PATH,'vcs_test'))
+            
+        tests = True    
+    
+    dbmanage = DbManage(log_sql, dbname, tests)
     dbmanage.create_tables(override=True)
-    dbmanage.config_prompt()
+    dbmanage.config_prompt(REPO_TEST_PATH)
+    dbmanage.create_default_user()
     dbmanage.admin_prompt()
     dbmanage.create_permissions()
     dbmanage.populate_default_permissions()
--- a/setup.cfg	Sun Sep 05 13:55:47 2010 +0200
+++ b/setup.cfg	Sun Sep 05 16:20:29 2010 +0200
@@ -6,7 +6,10 @@
 find_links = http://www.pylonshq.com/download/
 
 [nosetests]
-with-pylons = development.ini
+verbose=True
+verbosity=2
+with-pylons=tests.ini
+detailed-errors=1
 
 # Babel configuration
 [compile_catalog]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests.ini	Sun Sep 05 16:20:29 2010 +0200
@@ -0,0 +1,155 @@
+################################################################################
+################################################################################
+# pylons_app - Pylons environment configuration                                #
+#                                                                              # 
+# The %(here)s variable will be replaced with the parent directory of this file#
+################################################################################
+
+[DEFAULT]
+debug = true
+############################################
+## Uncomment and replace with the address ##
+## which should receive any error reports ##
+############################################
+#email_to = admin@localhost
+#smtp_server = mail.server.com
+#error_email_from = paste_error@localhost
+#smtp_username = 
+#smtp_password = 
+#error_message = 'mercurial crash !'
+
+[server:main]
+##nr of threads to spawn
+threadpool_workers = 5
+
+##max request before
+threadpool_max_requests = 2
+
+##option to use threads of process
+use_threadpool = true
+
+use = egg:Paste#http
+host = 127.0.0.1
+port = 5000
+
+[app:main]
+use = egg:pylons_app
+full_stack = true
+static_files = true
+lang=en
+cache_dir = %(here)s/data
+
+####################################
+###         BEAKER CACHE        ####
+####################################
+beaker.cache.data_dir=/%(here)s/data/cache/data
+beaker.cache.lock_dir=/%(here)s/data/cache/lock
+beaker.cache.regions=super_short_term,short_term,long_term
+beaker.cache.long_term.type=memory
+beaker.cache.long_term.expire=36000
+beaker.cache.short_term.type=memory
+beaker.cache.short_term.expire=60
+beaker.cache.super_short_term.type=memory
+beaker.cache.super_short_term.expire=10
+
+####################################
+###       BEAKER SESSION        ####
+####################################
+## Type of storage used for the session, current types are 
+## “dbm”, “file”, “memcached”, “database”, and “memory”. 
+## The storage uses the Container API 
+##that is also used by the cache system.
+beaker.session.type = file
+
+beaker.session.key = hg-app
+beaker.session.secret = g654dcno0-9873jhgfreyu
+beaker.session.timeout = 36000
+
+##auto save the session to not to use .save()
+beaker.session.auto = False
+
+##true exire at browser close
+#beaker.session.cookie_expires = 3600
+
+    
+################################################################################
+## WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*  ##
+## Debug mode will enable the interactive debugging tool, allowing ANYONE to  ##
+## execute malicious code after an exception is raised.                       ##
+################################################################################
+#set debug = false
+
+##################################
+###       LOGVIEW CONFIG       ###
+##################################
+logview.sqlalchemy = #faa
+logview.pylons.templating = #bfb
+logview.pylons.util = #eee
+
+#########################################################
+### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG    ###
+#########################################################
+sqlalchemy.db1.url = sqlite:///%(here)s/test.db
+#sqlalchemy.db1.echo = False
+#sqlalchemy.db1.pool_recycle = 3600
+sqlalchemy.convert_unicode = true
+
+################################
+### LOGGING CONFIGURATION   ####
+################################
+[loggers]
+keys = root, routes, pylons_app, sqlalchemy
+
+[handlers]
+keys = console
+
+[formatters]
+keys = generic,color_formatter
+
+#############
+## LOGGERS ##
+#############
+[logger_root]
+level = ERROR
+handlers = console
+
+[logger_routes]
+level = ERROR
+handlers = console
+qualname = routes.middleware
+# "level = DEBUG" logs the route matched and routing variables.
+
+[logger_pylons_app]
+level = ERROR
+handlers = console
+qualname = pylons_app
+propagate = 0
+
+[logger_sqlalchemy]
+level = ERROR
+handlers = console
+qualname = sqlalchemy.engine
+propagate = 0
+
+##############
+## HANDLERS ##
+##############
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = color_formatter
+
+################
+## FORMATTERS ##
+################
+
+[formatter_generic]
+format = %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
+datefmt = %Y-%m-%d %H:%M:%S
+
+[formatter_color_formatter]
+class=pylons_app.lib.colored_formatter.ColorFormatter
+format= %(asctime)s.%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
+datefmt = %Y-%m-%d %H:%M:%S
\ No newline at end of file