Skip to content

Commit

Permalink
#280 Use assertTrue instead raising exception
Browse files Browse the repository at this point in the history
  • Loading branch information
viliambalaz committed Nov 23, 2021
1 parent c56d2bf commit d07cb6f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions chcemvediet/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,10 @@ def _create_user(self, **kwargs):
def _login_user(self, user=None, password=u'default_testing_secret'):
if user is None:
user = self.user
if not self.client.login(username=user.username, password=password):
raise Exception(
u'The provided credentials are incorrect:\nusername: {} password: {}.'.format(
user.username, password
))
logged_in = self.client.login(username=user.username, password=password)
self.assertTrue(logged_in, u'The provided credentials are incorrect:\nusername: {} password: {}.'.format(
user.username, password
))

def _logout_user(self):
self.client.logout()
Expand Down

0 comments on commit d07cb6f

Please sign in to comment.