Mercurial > kallithea
changeset 3630:5d8cda8e63dc beta
fixed login tests
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 28 Mar 2013 03:29:38 +0100 |
parents | 802c94bdfc85 |
children | 10b4e34841a4 |
files | rhodecode/tests/functional/test_login.py |
diffstat | 1 files changed, 7 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/tests/functional/test_login.py Thu Mar 28 02:57:05 2013 +0100 +++ b/rhodecode/tests/functional/test_login.py Thu Mar 28 03:29:38 2013 +0100 @@ -29,7 +29,7 @@ self.assertEqual(response.session['rhodecode_user'].get('username'), 'test_admin') response = response.follow() - self.assertTrue('%s repository' % HG_REPO in response.body) + response.mustcontain('/%s' % HG_REPO) def test_login_regular_ok(self): response = self.app.post(url(controller='login', action='index'), @@ -40,8 +40,7 @@ self.assertEqual(response.session['rhodecode_user'].get('username'), 'test_regular') response = response.follow() - self.assertTrue('%s repository' % HG_REPO in response.body) - self.assertTrue('<a title="Admin" href="/_admin">' not in response.body) + response.mustcontain('/%s' % HG_REPO) def test_login_ok_came_from(self): test_came_from = '/_admin/users' @@ -53,7 +52,7 @@ response = response.follow() self.assertEqual(response.status, '200 OK') - self.assertTrue('Users administration' in response.body) + response.mustcontain('Users administration') @parameterized.expand([ ('data:text/html,<script>window.alert("xss")</script>',), @@ -80,22 +79,22 @@ 'password': 'as'}) self.assertEqual(response.status, '200 OK') - self.assertTrue('Enter 3 characters or more' in response.body) + response.mustcontain('Enter 3 characters or more') def test_login_wrong_username_password(self): response = self.app.post(url(controller='login', action='index'), {'username': 'error', 'password': 'test12'}) - self.assertTrue('invalid user name' in response.body) - self.assertTrue('invalid password' in response.body) + response.mustcontain('invalid user name') + response.mustcontain('invalid password') #========================================================================== # REGISTRATIONS #========================================================================== def test_register(self): response = self.app.get(url(controller='login', action='register')) - self.assertTrue('Sign Up to RhodeCode' in response.body) + response.mustcontain('Sign Up to RhodeCode') def test_register_err_same_username(self): uname = 'test_admin'