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

How to Write or test Post or Put api testcases ? #190

Open
Elixir-MeetThoriya opened this issue Oct 4, 2024 · 2 comments
Open

How to Write or test Post or Put api testcases ? #190

Elixir-MeetThoriya opened this issue Oct 4, 2024 · 2 comments

Comments

@Elixir-MeetThoriya
Copy link

Elixir-MeetThoriya commented Oct 4, 2024

this is my controller

@api_controller("users/", tags=["Users"])
 class UserController(BaseController):
     model = get_user_model()
     @http_post(
         path="",
         response={
             HTTPStatus.CREATED: UserSchema,
             HTTPStatus.INTERNAL_SERVER_ERROR: ErrorSchema,
             HTTPStatus.BAD_REQUEST: ErrorSchema,
         },
         # permissions=[AdminPermission],
         summary="Create Center User",
         description="This endpoint creates a new center user based on the provided data.",
         url_name="create_center_user"
     )
     def create(self, payload: UserInSchema):
         try:
@Elixir-MeetThoriya Elixir-MeetThoriya changed the title How to Write Post or Put api testcases ? How to Write or test Post or Put api testcases ? Oct 4, 2024
@eadwinCode
Copy link
Owner

@Elixir-MeetThoriya have you tried this https://eadwincode.github.io/django-ninja-extra/tutorial/testing/

@eadwinCode
Copy link
Owner

@Elixir-MeetThoriya Can you close this if the issue is resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants