diff pylons_app/tests/functional/test_login.py @ 462:298546182b41

more test suites on login, fixed strange detached instance bug found during in tests. on __repr__ function fixed timerproxy query formatting
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 05 Sep 2010 23:40:08 +0200
parents e95621133eb6
children a03250279b15
line wrap: on
line diff
--- a/pylons_app/tests/functional/test_login.py	Sun Sep 05 18:07:37 2010 +0200
+++ b/pylons_app/tests/functional/test_login.py	Sun Sep 05 23:40:08 2010 +0200
@@ -12,13 +12,19 @@
                                  {'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'