Skip to content

Commit 795cf47

Browse files
committed
Fix module name with Python 3.5
1 parent 944a171 commit 795cf47

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/test_request.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ def authenticate(self, request):
186186
try:
187187
self.request.user
188188
except AttributeError as error:
189-
self.assertEqual(str(error), "'module' object has no attribute 'MISSPELLED_NAME_THAT_DOESNT_EXIST'")
189+
assert str(error) in (
190+
"'module' object has no attribute 'MISSPELLED_NAME_THAT_DOESNT_EXIST'", # Python < 3.5
191+
"module 'rest_framework' has no attribute 'MISSPELLED_NAME_THAT_DOESNT_EXIST'", # Python >= 3.5
192+
)
190193
else:
191194
assert False, 'AttributeError not raised'
192195

0 commit comments

Comments
 (0)