diff --git a/MANIFEST.in b/MANIFEST.in --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,5 @@ +include COPYING +include README.rst include pylons_app/config/deployment.ini_tmpl include hg_app_daemon diff --git a/pylons_app/lib/timerproxy.py b/pylons_app/lib/timerproxy.py --- a/pylons_app/lib/timerproxy.py +++ b/pylons_app/lib/timerproxy.py @@ -22,6 +22,7 @@ def format_sql(sql): sql = sql.replace('\n', '') sql = one_space_trim(sql) sql = sql\ + .replace(',',',\n\t')\ .replace('SELECT', '\n\tSELECT \n\t')\ .replace('UPDATE', '\n\tUPDATE \n\t')\ .replace('DELETE', '\n\tDELETE \n\t')\ diff --git a/pylons_app/model/db.py b/pylons_app/model/db.py --- a/pylons_app/model/db.py +++ b/pylons_app/model/db.py @@ -56,7 +56,7 @@ class User(Base): self.last_login = datetime.datetime.now() session.add(self) session.commit() - log.debug('updated user %s lastlogin',self) + log.debug('updated user %s lastlogin',self.username) except Exception: session.rollback() diff --git a/pylons_app/tests/functional/test_hg.py b/pylons_app/tests/functional/test_hg.py new file mode 100644 --- /dev/null +++ b/pylons_app/tests/functional/test_hg.py @@ -0,0 +1,8 @@ +from pylons_app.tests import * + +class TestAdminController(TestController): + + def test_index(self): + + response = self.app.get(url(controller='hg', action='index')) + # Test response... \ No newline at end of file diff --git a/pylons_app/tests/functional/test_login.py b/pylons_app/tests/functional/test_login.py --- a/pylons_app/tests/functional/test_login.py +++ b/pylons_app/tests/functional/test_login.py @@ -12,13 +12,19 @@ class TestLoginController(TestController {'username':'test_admin', 'password':'test'}) assert response.status == '302 Found','Wrong response code from login' + assert response.session['hg_app_user'].username =='test_admin','wrong logged in user' + response = response.follow() + assert 'auto description for vcs_test' in response.body def test_login_regular_ok(self): response = self.app.post(url(controller='login', action='index'), - {'username':'test_admin', + {'username':'test_regular', 'password':'test'}) assert response.status == '302 Found','Wrong response code from login' - + assert response.session['hg_app_user'].username =='test_regular','wrong logged in user' + response = response.follow() + assert 'auto description for vcs_test' in response.body + assert '' not in response.body def test_login_ok_came_from(self): test_came_from = '/_admin/users'