Add a name on every route #762 (#774)

* 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:
Brandon H. Goding
2021-11-02 03:12:43 -04:00
committed by GitHub
parent e0e8dfbc3b
commit 0c45cbc179
12 changed files with 137 additions and 11 deletions

View File

@ -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