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 set query param for test. #1163

Open
changja88 opened this issue May 12, 2024 · 0 comments
Open

How to set query param for test. #1163

changja88 opened this issue May 12, 2024 · 0 comments

Comments

@changja88
Copy link

Here is the def
@nick_name_router.get(
path="",
response={200: MemberDuplicationOutSchema},
)
def api_nick_name_duplication_check(request: Router, nickname: str) -> APIResponse[MemberDuplicationOutSchema]:
is_exists: StrictBool = MemberRegisterApp().is_nickname_able(nick_name=nickname)
return MemberDuplicationOutSchema(is_able=not is_exists)

and test def is below
def test_api_register_member_wanted_info(self):
client = TestClient(nick_name_router)

response: NinjaResponse = client.get(path="", data={"nickname": "abc"}, content_type="application/json")
response: NinjaResponse = client.get(path="", nickname="abc", content_type="application/json")

print(response.json())

in this case test reuslt says I did not pass nickname query param.
How Can I pass nickname param in test case

Tanks

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

1 participant