Skip to content

Commit

Permalink
Update mixins.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Lorenz committed Apr 29, 2016
1 parent 265749e commit cb4b3c3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions django_libs/tests/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,13 @@ def is_postable(self, user=None, data=None, ajax=False, to=None,
if next_url:
next_url = '?next={0}'.format(next_url)
if to_url_name:
self.assertEqual(resolve(resp.url).url_name, to_url_name,
msg=msg)
try:
self.assertEqual(resolve(resp.url).url_name, to_url_name,
msg=msg)
except AttributeError:
raise AssertionError(
'The response returned with a status code {}'.format(
resp.status_code))
else:
redirect_url = '{0}{1}'.format(to, next_url)
self.assertRedirects(resp, redirect_url, msg=msg)
Expand Down

0 comments on commit cb4b3c3

Please sign in to comment.