-
-
Notifications
You must be signed in to change notification settings - Fork 7k
converted test asserts of generics-test to pytest #4715
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
Conversation
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.
There is a failing test that was caused by an error during the conversion.
@@ -530,8 +530,8 @@ def test_dynamic_serializer_form_in_browsable_api(self): | |||
view = DynamicSerializerView.as_view() | |||
request = factory.get('/') | |||
response = view(request).render() | |||
self.assertContains(response, 'field_b') | |||
self.assertNotContains(response, 'field_a') | |||
assert response is 'field_b' |
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.
This should be field_b in response
. Right now it's doing an is
check, which is definitely not what we were doing before.
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.
Note that assertContains
doesn't actually have a Python equivalent. It's a custom Django assertion that works based on the response content.
that didn't work either and initially i did what you suggested. SO keeping them as is for now. |
Should be something like:
|
ace ! |
I guess ready to go 🗡️ |
yes we are. I was just ensuring we couldn't use response.data instead but we're good. |
@xordoquy I am not sure if my assertion is done in wrong way or whats the reason of test fails?
suggestion?