mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-11-02 12:21:53 +08:00
* Names for urls added * Tests for Login/Logout Names * Register Name Test * tests/test_router_reset.py * Tests to verify url names in users router * Test Verify Router Names * oauth routes updated with prefix * Test for authorize. Didn't right test for callback as covered under other tests
This commit is contained in:
committed by
GitHub
parent
e0e8dfbc3b
commit
0c45cbc179
@ -157,6 +157,16 @@ class TestLogin:
|
||||
data = cast(Dict[str, Any], response.json())
|
||||
assert data["detail"] == ErrorCode.LOGIN_BAD_CREDENTIALS
|
||||
|
||||
async def test_login_namespace(
|
||||
self,
|
||||
path,
|
||||
app_factory
|
||||
):
|
||||
split_url = app_factory(True).url_path_for("auth:login").split("/")
|
||||
assert split_url[len(split_url) - 1] in path
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.router
|
||||
@pytest.mark.parametrize("path", ["/mock/logout", "/mock-bis/logout"])
|
||||
@ -199,3 +209,11 @@ class TestLogout:
|
||||
path, headers={"Authorization": f"Bearer {verified_user.id}"}
|
||||
)
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
|
||||
async def test_logout_namespace(
|
||||
self,
|
||||
path,
|
||||
app_factory
|
||||
):
|
||||
split_url = app_factory(True).url_path_for("auth:logout").split("/")
|
||||
assert split_url[len(split_url) - 1] in path
|
||||
|
||||
Reference in New Issue
Block a user