Skip to content

Conversation

behzadsh
Copy link

@behzadsh behzadsh commented Aug 5, 2017

Sometime when you testing an API response, you need to check that a key is not present in JSON response. I added assertJsonStructureMissing to TestResponse class that do this check.

@behzadsh behzadsh changed the title Add assertJsonMissingStructure to TestResponse [5.4] Add assertJsonMissingStructure to TestResponse Aug 5, 2017
@behzadsh behzadsh changed the title [5.4] Add assertJsonMissingStructure to TestResponse [5.4] Add assertJsonStructureMissing to TestResponse Aug 5, 2017
@taylorotwell
Copy link
Member

You can macro this in or release a package if you like.

@OrkhanAlikhanov
Copy link

I wonder what would be the reason for not accepting this addition. I find myself a lot during tests asserting that json structure misses some keys based on user's privileges, for example json should miss answer field if user is not teacher.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants