Skip to content

Commit

Permalink
Encode and cast lazy gettext to str
Browse files Browse the repository at this point in the history
Had error when testing with python2 and 3.
  • Loading branch information
Kevin Etienne committed Jan 28, 2015
1 parent 3ecc46c commit 9c6662a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion user_management/api/tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ def test_raise(self):
with self.assertRaises(InvalidExpiredToken) as e:
raise InvalidExpiredToken
self.assertEqual(e.exception.status_code, HTTP_400_BAD_REQUEST)
self.assertEqual(str(e.exception.detail), 'Invalid or expired token.')
message = str(e.exception.detail.encode('utf-8'))
self.assertEqual(message, 'Invalid or expired token.')

0 comments on commit 9c6662a

Please sign in to comment.