We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 944a171 + 795cf47 commit 5899b00Copy full SHA for 5899b00
tests/test_request.py
@@ -186,7 +186,10 @@ def authenticate(self, request):
186
try:
187
self.request.user
188
except AttributeError as error:
189
- self.assertEqual(str(error), "'module' object has no attribute 'MISSPELLED_NAME_THAT_DOESNT_EXIST'")
+ 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
+ )
193
else:
194
assert False, 'AttributeError not raised'
195
0 commit comments