Skip to content

Commit

Permalink
Fix module name with Python 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
xordoquy committed Nov 11, 2015
1 parent 944a171 commit 795cf47
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ def authenticate(self, request):
try:
self.request.user
except AttributeError as error:
self.assertEqual(str(error), "'module' object has no attribute 'MISSPELLED_NAME_THAT_DOESNT_EXIST'")
assert str(error) in (
"'module' object has no attribute 'MISSPELLED_NAME_THAT_DOESNT_EXIST'", # Python < 3.5
"module 'rest_framework' has no attribute 'MISSPELLED_NAME_THAT_DOESNT_EXIST'", # Python >= 3.5
)
else:
assert False, 'AttributeError not raised'

Expand Down

0 comments on commit 795cf47

Please sign in to comment.