Skip to content

Commit 5899b00

Browse files
committed
Merge pull request #3626 from linovia/bug/fix_failing_py35_test_case
Fix module name with Python 3.5 (#3534)
2 parents 944a171 + 795cf47 commit 5899b00

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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)