Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Even though Django Ninja is compatible with Django itself, the way DRF and Django Ninja responses work is slightly different.
For testing (which concerns to this package), DRF endpoints responses are of type
rest_framework.response.Response
wheres Django Ninja ones are of typedjango.http.response.HttpResponse
This brings the need of adapting the package in order to properly handle responses for contract validation.
It will also bring other necessary later enhancements specially as we extend the package, but the goal for this PR is just give the minimum support to make it work with Django Ninja APIs as it is.
Changes
django.http.response.HttpResponse
type responses.django-ninja
as extra dependency.django-ninja
API as part of the test project and corresponding tests3.8