Changeset - 298546182b41
[Not reviewed]
default
0 4 1
Marcin Kuzminski - 15 years ago 2010-09-05 23:40:08
marcin@python-works.com
more test suites on login, fixed strange detached instance bug found during in tests.
on __repr__ function
fixed timerproxy query formatting
5 files changed with 20 insertions and 3 deletions:
0 comments (0 inline, 0 general)
MANIFEST.in
Show inline comments
 
include COPYING
 
include README.rst
 
include pylons_app/config/deployment.ini_tmpl
 

	
 
include hg_app_daemon
pylons_app/lib/timerproxy.py
Show inline comments
 
@@ -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')\
pylons_app/model/db.py
Show inline comments
 
@@ -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()        
 
    
pylons_app/tests/functional/test_hg.py
Show inline comments
 
new file 100644
 
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
pylons_app/tests/functional/test_login.py
Show inline comments
 
@@ -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 '<a title="Admin" href="/_admin">' not in response.body
 
    
 
    def test_login_ok_came_from(self):
 
        test_came_from = '/_admin/users'
0 comments (0 inline, 0 general)