changeset 473:6b934c9607e7 celery

Improved testing scenarios. Made test env creator Fixed hg_model error message some other tweeks and fixes Models fixe for uniq email, and removed some extra not needed imports from model main module
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 13 Sep 2010 01:23:58 +0200
parents 91292686c1ed
children a3d9d24acbec
files pylons_app/config/environment.py pylons_app/controllers/admin/settings.py pylons_app/controllers/summary.py pylons_app/lib/utils.py pylons_app/model/__init__.py pylons_app/model/db.py pylons_app/model/hg_model.py pylons_app/tests/__init__.py pylons_app/tests/functional/test_admin.py pylons_app/tests/functional/test_branches.py pylons_app/tests/functional/test_changelog.py pylons_app/tests/functional/test_feed.py pylons_app/tests/functional/test_files.py pylons_app/tests/functional/test_login.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 test.ini tests.ini
diffstat 22 files changed, 304 insertions(+), 199 deletions(-) [+]
line wrap: on
line diff
--- a/pylons_app/config/environment.py	Sun Sep 12 22:42:03 2010 +0200
+++ b/pylons_app/config/environment.py	Mon Sep 13 01:23:58 2010 +0200
@@ -49,7 +49,10 @@
 
     #sets the c attribute access when don't existing attribute are accessed
     config['pylons.strict_tmpl_context'] = True
-    test = os.path.split(config['__file__'])[-1] == 'tests.ini'
+    test = os.path.split(config['__file__'])[-1] == 'test.ini'
+    if test:
+        from pylons_app.lib.utils import make_test_env
+        make_test_env()
     #MULTIPLE DB configs
     # Setup the SQLAlchemy database engine
     if config['debug'] and not test:
--- a/pylons_app/controllers/admin/settings.py	Sun Sep 12 22:42:03 2010 +0200
+++ b/pylons_app/controllers/admin/settings.py	Mon Sep 13 01:23:58 2010 +0200
@@ -106,7 +106,7 @@
         if setting_id == 'whoosh':
             repo_location = get_hg_ui_settings()['paths_root_path']
             full_index = request.POST.get('full_index',False)
-            task = run_task(tasks.whoosh_index,True,repo_location,full_index)
+            task = run_task(tasks.whoosh_index,repo_location,full_index)
             
             h.flash(_('Whoosh reindex task scheduled'), category='success')
         if setting_id == 'global':
--- a/pylons_app/controllers/summary.py	Sun Sep 12 22:42:03 2010 +0200
+++ b/pylons_app/controllers/summary.py	Mon Sep 13 01:23:58 2010 +0200
@@ -61,7 +61,7 @@
         for name, hash in c.repo_info.branches.items()[:10]:
             c.repo_branches[name] = c.repo_info.get_changeset(hash)
         
-        task = run_task(get_commits_stats,False,c.repo_info.name)
+        task = run_task(get_commits_stats,c.repo_info.name)
         c.ts_min = task.result[0]
         c.ts_max = task.result[1]
         c.commit_data = task.result[2]
--- a/pylons_app/lib/utils.py	Sun Sep 12 22:42:03 2010 +0200
+++ b/pylons_app/lib/utils.py	Mon Sep 13 01:23:58 2010 +0200
@@ -16,6 +16,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 # MA  02110-1301, USA.
+import shutil
 
 """
 Created on April 18, 2010
@@ -31,6 +32,8 @@
 from vcs.utils.lazy import LazyProperty
 import logging
 import os
+from os.path import dirname as dn, join as jn
+import tarfile
 log = logging.getLogger(__name__)
 
 
@@ -362,3 +365,68 @@
 
     def __ne__(self, other):
         return not self == other
+
+def make_test_env():
+    """Makes a fresh database from base64+zlib dump and 
+    install test repository into tmp dir
+    """
+    new_db_dump = """
+eJztXN1vE8sVn9nxR+wAIXDpFiiXjSAXfEOc2ElwQkVLPjYf5NNOAklUydrYG3tv1t5ldx0nuUJV\noL
+cPrVr1X7jSfUJ96nMfK1Xty23VqlWlPlRIlahUXbXqFUL0pTNjx5614xAoKEDmJ3t2zpkzM2fO\neHe+
+zno+PqU5qrRmWDnFkXqAB0AIbkkSAKANf8+BKprwFzI0G28ECXQ+PufFEYT+Tehz6L/oaSnK\nwcFxGP
+igFQfHjuMg4CehH7UA9Af0Y2ShWdSPLmOSg+N9x7U9eKf9PiC2nIWm4mTtri4nZ3Z9DE/5\nfOD0+RZY
+VFdXFVstWHoXPOPFvDbKU3TdKCbNgp39GLZ5MPtK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WdJU212fgJl93ZFGJ06qPWwNg0rWLkuuVPwxm2RfcS2YVOWrVTlm
+a61o6uXimr4bJ4\npfp67r6So7MJeWJshhRcWf1ICXlUTsgzw/L87vpuj4XRrubsOjN2zCdOtjfqJNac
+yQhLtcSOHzhj\nlKVOlsb/fwL0FAccHBzvLQJIhHRpIJAYXRPQ8R+i3wP84eDgeNfRCX3gAoRjGyk7Sc
+78BUDPZdlJ\n0ZphSbvJZPyH6D8Afzg4ON5/HEMX4O7tD0v3/3OAPxwcHEcG1f0/hJ4A9Az9C184ODje
+Q/gQ+WcP\nKPgEevX5IL0GyPiP0Fdl/7/D1pKDg+PNYe/3f+j4/wSP/88OWz8ODo43Ab+H3O0CKl19Qu
+kaoPN/\nD/gcgM+FD4W7ws8OW886PNg+UTp4jlX8aJOOQR0a2XhrnVftbkrFubZM7+dkewA/zgYS9a6x
+1erq\nXWRr0thDZLdfJ3uU7PI+rXcMfYWT6Bq33WtSrVNprGW/Y2VXUyIsdSp28sAZoyx1+kGulXqTfx
+aq\ndrduZOxK5Ex9RxN2pZcx8So9XEozKw4D1Vdn6v0RFLdfeolM0r/U2d9buqRbvekZ/iv0IpulqrYr
+\nl9sRo+rBEAyR+x8/ADg4OI4gyPyf3/8cHEcTJf+fpwB/ODg4jgSaoBfQ/QB+/s/BcSRR3f+H6Bng\n
+e/8cHEcHpf1/CI+jHwEP3AToLtx8e9/9e//w8Hun6bHGDz+tvE+3uwfOxsW69+nYYw2WfjPHGtX9\n5A
+MdfNQo9P+eS7youNdyVuJq4ot2zRsdnLgLCYYip/b7w5jKqUX51IREv4F/FJ7YBy96ja963sJS\n34yd
+OXDGKEud/R8efZUt\n
+"""    
+    newdb = open('test.db','wb')
+    newdb.write(new_db_dump.decode('base64').decode('zlib'))
+    newdb.close()
+    
+    
+    #PART TWO make test repo
+    if os.path.isdir('/tmp/vcs_test'):
+        shutil.rmtree('/tmp/vcs_test')
+        
+    cur_dir = dn(dn(os.path.abspath(__file__)))
+    tar = tarfile.open(jn(cur_dir,'tests',"vcs_test.tar.gz"))
+    tar.extractall('/tmp')
+    tar.close()
+    
+    
+    
\ No newline at end of file
--- a/pylons_app/model/__init__.py	Sun Sep 12 22:42:03 2010 +0200
+++ b/pylons_app/model/__init__.py	Mon Sep 13 01:23:58 2010 +0200
@@ -1,15 +1,8 @@
 """The application's model objects"""
 import logging
-import sqlalchemy as sa
-from sqlalchemy import orm
 from pylons_app.model import meta
-from pylons_app.model.meta import Session
 log = logging.getLogger(__name__)
 
-# Add these two imports:
-import datetime
-from sqlalchemy import schema, types
-
 def init_model(engine):
     """Call me before using any of the tables or classes in the model"""
     log.info("INITIALIZING DB MODELS")
--- a/pylons_app/model/db.py	Sun Sep 12 22:42:03 2010 +0200
+++ b/pylons_app/model/db.py	Mon Sep 13 01:23:58 2010 +0200
@@ -26,7 +26,7 @@
     
 class User(Base): 
     __tablename__ = 'users'
-    __table_args__ = (UniqueConstraint('username'), {'useexisting':True})
+    __table_args__ = (UniqueConstraint('username'), UniqueConstraint('email'), {'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)
@@ -56,7 +56,7 @@
             self.last_login = datetime.datetime.now()
             session.add(self)
             session.commit()
-            log.debug('updated user %s lastlogin',self.username)
+            log.debug('updated user %s lastlogin', self.username)
         except Exception:
             session.rollback()        
     
--- a/pylons_app/model/hg_model.py	Sun Sep 12 22:42:03 2010 +0200
+++ b/pylons_app/model/hg_model.py	Mon Sep 13 01:23:58 2010 +0200
@@ -102,7 +102,7 @@
             if repos_path[0] != '/':
                 repos_path[0] = '/'
             if not os.path.isdir(os.path.join(*repos_path)):
-                raise RepositoryError('Not a valid repository in %s' % path[0][1])        
+                raise RepositoryError('Not a valid repository in %s' % path)        
         if not repos_path.endswith('*'):
             raise VCSError('You need to specify * or ** at the end of path '
                             'for recursive scanning')
--- a/pylons_app/tests/__init__.py	Sun Sep 12 22:42:03 2010 +0200
+++ b/pylons_app/tests/__init__.py	Mon Sep 13 01:23:58 2010 +0200
@@ -16,12 +16,15 @@
 from webtest import TestApp
 import os
 from pylons_app.model import meta
+import logging
+log = logging.getLogger(__name__) 
+
 import pylons.test
 
 __all__ = ['environ', 'url', 'TestController']
 
 # Invoke websetup with the current config file
-SetupCommand('setup-app').run([pylons.test.pylonsapp.config['__file__']])
+#SetupCommand('setup-app').run([pylons.test.pylonsapp.config['__file__']])
 
 environ = {}
 
@@ -42,4 +45,5 @@
                                   'password':'test'})
         assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status
         assert response.session['hg_app_user'].username == 'test_admin', 'wrong logged in user'
-        return response.follow()        
\ No newline at end of file
+        return response.follow()
+    
\ No newline at end of file
--- a/pylons_app/tests/functional/test_admin.py	Sun Sep 12 22:42:03 2010 +0200
+++ b/pylons_app/tests/functional/test_admin.py	Mon Sep 13 01:23:58 2010 +0200
@@ -3,5 +3,7 @@
 class TestAdminController(TestController):
 
     def test_index(self):
+        self.log_user()
         response = self.app.get(url(controller='admin/admin', action='index'))
+        assert 'Admin dashboard - journal' in response.body,'No proper title in dashboard'
         # Test response...
--- a/pylons_app/tests/functional/test_branches.py	Sun Sep 12 22:42:03 2010 +0200
+++ b/pylons_app/tests/functional/test_branches.py	Mon Sep 13 01:23:58 2010 +0200
@@ -3,5 +3,6 @@
 class TestBranchesController(TestController):
 
     def test_index(self):
+        self.log_user()
         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 12 22:42:03 2010 +0200
+++ b/pylons_app/tests/functional/test_changelog.py	Mon Sep 13 01:23:58 2010 +0200
@@ -3,5 +3,6 @@
 class TestChangelogController(TestController):
 
     def test_index(self):
+        self.log_user()
         response = self.app.get(url(controller='changelog', action='index',repo_name='vcs_test'))
         # Test response...
--- a/pylons_app/tests/functional/test_feed.py	Sun Sep 12 22:42:03 2010 +0200
+++ b/pylons_app/tests/functional/test_feed.py	Mon Sep 13 01:23:58 2010 +0200
@@ -3,11 +3,13 @@
 class TestFeedController(TestController):
 
     def test_rss(self):
+        self.log_user()
         response = self.app.get(url(controller='feed', action='rss',
                                     repo_name='vcs_test'))
         # Test response...
 
     def test_atom(self):
+        self.log_user()
         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 12 22:42:03 2010 +0200
+++ b/pylons_app/tests/functional/test_files.py	Mon Sep 13 01:23:58 2010 +0200
@@ -3,6 +3,7 @@
 class TestFilesController(TestController):
 
     def test_index(self):
+        self.log_user()
         response = self.app.get(url(controller='files', action='index',
                                     repo_name='vcs_test',
                                     revision='tip',
--- a/pylons_app/tests/functional/test_login.py	Sun Sep 12 22:42:03 2010 +0200
+++ b/pylons_app/tests/functional/test_login.py	Mon Sep 13 01:23:58 2010 +0200
@@ -82,9 +82,9 @@
         
         
     def test_register_ok(self):
-        username = 'test_regular2'
+        username = 'test_regular4'
         password = 'qweqwe'
-        email = 'goodmail@mail.com'
+        email = 'marcin@somemail.com'
         name = 'testname'
         lastname = 'testlastname'
         
@@ -94,10 +94,11 @@
                                              'email':email,
                                              'name':name,
                                              'lastname':lastname})
-        
+        print response.body
         assert response.status == '302 Found', 'Wrong response from register page got %s' % response.status        
+        assert 'You have successfully registered into hg-app' in response.session['flash'][0], 'No flash message about user registration'
         
-        ret = self.sa.query(User).filter(User.username == 'test_regular2').one()
+        ret = self.sa.query(User).filter(User.username == 'test_regular4').one()
         assert ret.username == username , 'field mismatch %s %s' % (ret.username, username)
         assert check_password(password,ret.password) == True , 'password mismatch'
         assert ret.email == email , 'field mismatch %s %s' % (ret.email, email)
@@ -105,7 +106,34 @@
         assert ret.lastname == lastname , 'field mismatch %s %s' % (ret.lastname, lastname)
     
         
+    def test_forgot_password_wrong_mail(self):    
+        response = self.app.post(url(controller='login', action='password_reset'),
+                                            {'email':'marcin@wrongmail.org',})
+        
+        assert "That e-mail address doesn't exist" in response.body,'Missing error message about wrong email'
+                
+    def test_forgot_password(self):
+        response = self.app.get(url(controller='login', action='password_reset'))
+        assert response.status == '200 OK', 'Wrong response from login page got %s' % response.status
+
+        username = 'test_password_reset_1'
+        password = 'qweqwe'
+        email = 'marcin@python-works.com'
+        name = 'passwd'
+        lastname = 'reset'
+                
+        response = self.app.post(url(controller='login', action='register'),
+                                            {'username':username,
+                                             'password':password,
+                                             'email':email,
+                                             'name':name,
+                                             'lastname':lastname})        
+        #register new user for email test
+        response = self.app.post(url(controller='login', action='password_reset'),
+                                            {'email':email,})
+        print response.session['flash']
+        assert 'You have successfully registered into hg-app' in response.session['flash'][0], 'No flash message about user registration'
+        assert 'Your new password was sent' in response.session['flash'][1], 'No flash message about password reset'
         
         
         
-        
--- a/pylons_app/tests/functional/test_settings.py	Sun Sep 12 22:42:03 2010 +0200
+++ b/pylons_app/tests/functional/test_settings.py	Mon Sep 13 01:23:58 2010 +0200
@@ -3,6 +3,7 @@
 class TestSettingsController(TestController):
 
     def test_index(self):
+        self.log_user()
         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 12 22:42:03 2010 +0200
+++ b/pylons_app/tests/functional/test_shortlog.py	Mon Sep 13 01:23:58 2010 +0200
@@ -3,5 +3,6 @@
 class TestShortlogController(TestController):
 
     def test_index(self):
+        self.log_user()
         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 12 22:42:03 2010 +0200
+++ b/pylons_app/tests/functional/test_summary.py	Mon Sep 13 01:23:58 2010 +0200
@@ -3,5 +3,6 @@
 class TestSummaryController(TestController):
 
     def test_index(self):
+        self.log_user()
         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 12 22:42:03 2010 +0200
+++ b/pylons_app/tests/functional/test_tags.py	Mon Sep 13 01:23:58 2010 +0200
@@ -3,5 +3,6 @@
 class TestTagsController(TestController):
 
     def test_index(self):
+        self.log_user()
         response = self.app.get(url(controller='tags', action='index',repo_name='vcs_test'))
         # Test response...
--- a/pylons_app/websetup.py	Sun Sep 12 22:42:03 2010 +0200
+++ b/pylons_app/websetup.py	Mon Sep 13 01:23:58 2010 +0200
@@ -1,40 +1,38 @@
 """Setup the pylons_app application"""
 
-from os.path import dirname as dn, join as jn
+from os.path import dirname as dn
 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 tarfile
 
 log = logging.getLogger(__name__)
 
 ROOT = dn(dn(os.path.realpath(__file__)))
 sys.path.append(ROOT)
 
+
 def setup_app(command, conf, vars):
     """Place any commands to setup pylons_app here"""
     log_sql = True
     tests = False
+    REPO_TEST_PATH = None
     
     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)
-            cur_dir = dn(os.path.abspath(__file__))
-            tar = tarfile.open(jn(cur_dir,'tests',"vcs_test.tar.gz"))
-            tar.extractall(REPO_TEST_PATH)
-            tar.close()
-            
-        tests = True    
+#    filename = os.path.split(conf.filename)[-1]
+#    if filename == 'test.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)
+#            cur_dir = dn(os.path.abspath(__file__))
+#            tar = tarfile.open(jn(cur_dir,'tests',"vcs_test.tar.gz"))
+#            tar.extractall(REPO_TEST_PATH)
+#            tar.close()
+#            
+#        tests = True    
     
     dbmanage = DbManage(log_sql, dbname, tests)
     dbmanage.create_tables(override=True)
--- a/setup.cfg	Sun Sep 12 22:42:03 2010 +0200
+++ b/setup.cfg	Mon Sep 13 01:23:58 2010 +0200
@@ -8,7 +8,7 @@
 [nosetests]
 verbose=True
 verbosity=2
-with-pylons=tests.ini
+with-pylons=test.ini
 detailed-errors=1
 
 # Babel configuration
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test.ini	Mon Sep 13 01:23:58 2010 +0200
@@ -0,0 +1,160 @@
+################################################################################
+################################################################################
+# hg-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 after application crash								  ##
+## Additionally those settings will be used by hg-app mailing system          ##
+################################################################################
+#email_to = admin@localhost
+#error_email_from = paste_error@localhost
+#app_email_from = hg-app-noreply@localhost
+#error_message =
+
+#smtp_server = mail.server.com
+#smtp_username = 
+#smtp_password = 
+#smtp_port = 
+#smtp_use_tls = false
+
+[server:main]
+##nr of threads to spawn
+threadpool_workers = 5
+
+##max request before thread respawn
+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
--- a/tests.ini	Sun Sep 12 22:42:03 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-################################################################################
-################################################################################
-# hg-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 after application crash								  ##
-## Additionally those settings will be used by hg-app mailing system          ##
-################################################################################
-#email_to = admin@localhost
-#error_email_from = paste_error@localhost
-#app_email_from = hg-app-noreply@localhost
-#error_message =
-
-#smtp_server = mail.server.com
-#smtp_username = 
-#smtp_password = 
-#smtp_port = 
-#smtp_use_tls = false
-
-[server:main]
-##nr of threads to spawn
-threadpool_workers = 5
-
-##max request before thread respawn
-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