From f5a3ca73c939d3b527e592b009f015c7ba557a16 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc" Date: Sat, 27 Jun 2020 17:24:20 -0500 Subject: [PATCH] Route names must match pgwui component names --- README.rst | 4 ++-- src/pgwui_logout/__init__.py | 3 ++- tests/test___init__.py | 7 ++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index abd0cbc..65f7321 100644 --- a/README.rst +++ b/README.rst @@ -55,10 +55,10 @@ URL Configuration ----------------- The default URL for PGWUI_Logout looks like -*https://www.example.com/logout*. The route name is ``logout``. +*https://www.example.com/logout*. See the PGWUI_Common documentation for how to configure a different -route. +URL. Complete Documentation diff --git a/src/pgwui_logout/__init__.py b/src/pgwui_logout/__init__.py index 85ab56a..b97e730 100644 --- a/src/pgwui_logout/__init__.py +++ b/src/pgwui_logout/__init__.py @@ -22,11 +22,12 @@ '''Provide a way to configure PGWUI. ''' +PGWUI_COMPONENT = 'pgwui_logout' DEFAULT_LOGOUT_ROUTE = '/logout' def includeme(config): '''Pyramid configuration for PGWUI_Logout ''' - config.add_route('logout', DEFAULT_LOGOUT_ROUTE) + config.add_route(PGWUI_COMPONENT, DEFAULT_LOGOUT_ROUTE) config.scan() diff --git a/tests/test___init__.py b/tests/test___init__.py index 493f51b..66b9afb 100644 --- a/tests/test___init__.py +++ b/tests/test___init__.py @@ -1,4 +1,5 @@ -# Copyright (C) 2018, 2019 The Meme Factory, Inc. http://www.meme.com/ +# Copyright (C) 2018, 2019, 2020 The Meme Factory, Inc. +# http://www.karlpinc.com/ # This file is part of PGWUI_Logout. # @@ -17,7 +18,7 @@ # . # -# Karl O. Pinc +# Karl O. Pinc import pyramid.config from pyramid.threadlocal import get_current_request @@ -46,7 +47,7 @@ def test_includeme_functional(pyramid_request_config): pgwui_logout_init.includeme(pyramid_request_config) request = get_current_request() - logout_path = request.route_path('logout') + logout_path = request.route_path('pgwui_logout') assert logout_path == pgwui_logout_init.DEFAULT_LOGOUT_ROUTE -- 2.34.1