Skip to content
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

Fixed #33301 -- Clarified the type of arguments required by custom assertions. #15106

Merged
merged 3 commits into from Nov 26, 2021

Conversation

bmispelon
Copy link
Member

No description provided.

@bmispelon bmispelon force-pushed the ticket-33301-doc-assertformerror branch from 07140c7 to c271a67 Compare November 21, 2021 10:43
@felixxm felixxm force-pushed the ticket-33301-doc-assertformerror branch from cdc5a21 to 9ac92b1 Compare November 26, 2021 12:13
Copy link
Member

@felixxm felixxm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bmispelon Thanks 👍 I pushed small edits.

response = HttpResponse()

with self.assertRaisesMessage(ValueError, msg):
self.assertFormsetError(response, 'formset', 0, 'field', "invalid value")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.assertFormsetError(response, 'formset', 0, 'field', "invalid value")
self.assertFormError(response, 'form', 'field', 'invalid value')

response = HttpResponse()

with self.assertRaisesMessage(ValueError, msg):
self.assertFormError(response, 'form', 'field', "invalid value")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.assertFormError(response, 'form', 'field', "invalid value")
self.assertFormsetError(response, 'formset', 0, 'field', 'invalid value')

@felixxm felixxm changed the title Ticket 33301: doc and API improvements for assertFormError and assertformsetError Fixed #33301 -- Clarified the type of arguments required by custom assertions. Nov 26, 2021
@felixxm felixxm merged commit 9ac92b1 into django:main Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants