aboutsummaryrefslogtreecommitdiff
path: root/rhodecode/tests
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2013-03-28 03:29:38 +0100
committerMarcin Kuzminski <marcin@python-works.com>2013-03-28 03:29:38 +0100
commitaa0468b7bdbc776dcd821451d3b4645ec13c2293 (patch)
treef7380ff349b852f67895e586cba694a7497b3630 /rhodecode/tests
parentd4cdb07f3bd8a91c7608fa4e159b0506e5573041 (diff)
fixed login tests
--HG-- branch : beta extra : amend_source : 5c7f4e306ed4346928a79c082b61a4b4051dada9
Diffstat (limited to 'rhodecode/tests')
-rw-r--r--rhodecode/tests/functional/test_login.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/rhodecode/tests/functional/test_login.py b/rhodecode/tests/functional/test_login.py
index a119cc24..f7566639 100644
--- a/rhodecode/tests/functional/test_login.py
+++ b/rhodecode/tests/functional/test_login.py
@@ -29,7 +29,7 @@ class TestLoginController(TestController):
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 @@ class TestLoginController(TestController):
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 @@ class TestLoginController(TestController):
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 @@ class TestLoginController(TestController):
'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'