-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Refs #35728 -- Added standard failure prefixes to assertion message tests. #19588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ing assertRaisesMessage. Also added standard unittest-inherited prefixes (e.g. "1 != 2 : ") to expected error messages. Refs #36280.
…ollowing redirect chains.
"(expected 302)", | ||
str(e), | ||
|
||
def test_followed_redirect_unexpected_initial_status_code(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could remove the assertions:
django/django/test/testcases.py
Lines 428 to 437 in b2407e4
self.assertEqual( | |
response.redirect_chain[0][1], | |
status_code, | |
msg_prefix | |
+ ( | |
"Initial response didn't redirect as expected: Response code was " | |
"%d (expected %d)" | |
) | |
% (response.redirect_chain[0][1], status_code), | |
) |
django/django/test/testcases.py
Lines 441 to 450 in b2407e4
self.assertEqual( | |
response.status_code, | |
target_status_code, | |
msg_prefix | |
+ ( | |
"Response didn't redirect as expected: Final Response code was %d " | |
"(expected %d)" | |
) | |
% (response.status_code, target_status_code), | |
) |
Marking as draft as the As it currently stands, here are the reasons why we may not need to keep (or test) the message prefixes from unittest:
|
Trac ticket number
Two additional commits I added while working on this:
test_contains()
test into smaller focused tests (10+)ticket-35728