Mercurial > kallithea
comparison rhodecode/tests/functional/test_login.py @ 688:8acbfa837180 beta
Tests rewrite for 1.2 added some globals configs to make tests easier.
Fixed search index_location to take from configuration files now
fixed git http_user_agent bug
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 14 Nov 2010 17:24:32 +0100 |
parents | 758f64f3fbda |
children | 7486da5f0628 |
comparison
equal
deleted
inserted
replaced
687:b9442a8b5e02 | 688:8acbfa837180 |
---|---|
15 {'username':'test_admin', | 15 {'username':'test_admin', |
16 'password':'test12'}) | 16 'password':'test12'}) |
17 assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status | 17 assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status |
18 assert response.session['rhodecode_user'].username == 'test_admin', 'wrong logged in user' | 18 assert response.session['rhodecode_user'].username == 'test_admin', 'wrong logged in user' |
19 response = response.follow() | 19 response = response.follow() |
20 assert 'vcs_test repository' in response.body | 20 assert '%s repository' % HG_REPO in response.body |
21 | 21 |
22 def test_login_regular_ok(self): | 22 def test_login_regular_ok(self): |
23 response = self.app.post(url(controller='login', action='index'), | 23 response = self.app.post(url(controller='login', action='index'), |
24 {'username':'test_regular', | 24 {'username':'test_regular', |
25 'password':'test12'}) | 25 'password':'test12'}) |
26 print response | 26 print response |
27 assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status | 27 assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status |
28 assert response.session['rhodecode_user'].username == 'test_regular', 'wrong logged in user' | 28 assert response.session['rhodecode_user'].username == 'test_regular', 'wrong logged in user' |
29 response = response.follow() | 29 response = response.follow() |
30 assert 'vcs_test repository' in response.body | 30 assert '%s repository' % HG_REPO in response.body |
31 assert '<a title="Admin" href="/_admin">' not in response.body | 31 assert '<a title="Admin" href="/_admin">' not in response.body |
32 | 32 |
33 def test_login_ok_came_from(self): | 33 def test_login_ok_came_from(self): |
34 test_came_from = '/_admin/users' | 34 test_came_from = '/_admin/users' |
35 response = self.app.post(url(controller='login', action='index', came_from=test_came_from), | 35 response = self.app.post(url(controller='login', action='index', came_from=test_came_from), |