Mercurial > kallithea
changeset 5915:151459ea3bd1
pytest migration: __init__: switch to standard assert statements
Use unittest2pytest to replace unittest-style assert statements (e.g.
assertEqual) with standard Python assert statements to benefit from pytest's
improved reporting on assert failures.
The conversion by unittest2pytest was correct.
author | Thomas De Schampheleire <thomas.de.schampheleire@gmail.com> |
---|---|
date | Sat, 14 May 2016 20:54:12 +0200 |
parents | be1d366f461c |
children | 062b4418ca9d |
files | kallithea/tests/__init__.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/tests/__init__.py Sat May 14 21:04:26 2016 +0200 +++ b/kallithea/tests/__init__.py Sat May 14 20:54:12 2016 +0200 @@ -198,7 +198,7 @@ if 'Invalid username or password' in response.body: pytest.fail('could not login using %s %s' % (username, password)) - self.assertEqual(response.status, '302 Found') + assert response.status == '302 Found' self.assert_authenticated_user(response, username) response = response.follow() @@ -212,7 +212,7 @@ user = cookie and cookie.get('user_id') user = user and User.get(user) user = user and user.username - self.assertEqual(user, expected_username) + assert user == expected_username def authentication_token(self): return self.app.get(url('authentication_token')).body