From 08cfd9f5b6163e34ea6c8c1be4563f62faae604d Mon Sep 17 00:00:00 2001 From: Brandon Rodriguez <brodriguez8774@gmail.com> Date: Sun, 11 Aug 2024 23:52:18 -0400 Subject: [PATCH] Correct many folder references to match project root folder rename --- MANIFEST.in | 6 +- README.md | 6 +- .../management/commands/showviews.py | 2 +- .../templatetags/admin/admin_menu.py | 4 +- .../templatetags/adminlte_tags.py | 2 +- .../templatetags/sidebar_menu.py | 6 +- docs/generate_docs.sh | 2 +- docs/source/api_reference.rst | 6 +- docs/source/api_reference/adminlte2_pdq.rst | 101 ---------- .../adminlte2_pdq.templatetags.admin.rst | 45 ----- .../adminlte2_pdq.templatetags.rst | 45 ----- ...ango_adminlte2_pdq.management.commands.rst | 37 ++++ .../django_adminlte2_pdq.management.rst | 18 ++ .../api_reference/django_adminlte2_pdq.rst | 102 ++++++++++ ...jango_adminlte2_pdq.templatetags.admin.rst | 45 +++++ .../django_adminlte2_pdq.templatetags.rst | 45 +++++ docs/source/authorization/class_views.rst | 14 +- docs/source/authorization/function_views.rst | 16 +- docs/source/conf.py | 4 +- docs/source/demo_css.rst | 2 +- docs/source/menu/admin.rst | 6 +- docs/source/quickstart.rst | 6 +- tests/settings.py | 4 +- tests/tests/test_decorators/base_test_case.py | 4 +- .../test_isolated_decorators.py | 4 +- .../test_login_required_mode.py | 16 +- .../tests/test_decorators/test_loose_mode.py | 6 +- .../tests/test_decorators/test_strict_mode.py | 64 +++--- tests/tests/test_middleware.py | 32 +-- tests/tests/test_mixins/base_test_case.py | 4 +- .../tests/test_mixins/test_isolated_mixins.py | 4 +- .../test_mixins/test_login_required_mode.py | 16 +- tests/tests/test_mixins/test_loose_mode.py | 4 +- tests/tests/test_mixins/test_strict_mode.py | 74 +++---- tests/tests/test_templatefilters.py | 2 +- tests/tests/test_templatetags.py | 2 +- tests/tests/test_templatetags_admin_menu.py | 2 +- tests/tests/test_templatetags_sidebar_menu.py | 186 +++++++++--------- tests/tests/test_views.py | 2 +- tests/urls.py | 4 +- tests/views.py | 4 +- 41 files changed, 506 insertions(+), 448 deletions(-) delete mode 100644 docs/source/api_reference/adminlte2_pdq.rst delete mode 100644 docs/source/api_reference/adminlte2_pdq.templatetags.admin.rst delete mode 100644 docs/source/api_reference/adminlte2_pdq.templatetags.rst create mode 100644 docs/source/api_reference/django_adminlte2_pdq.management.commands.rst create mode 100644 docs/source/api_reference/django_adminlte2_pdq.management.rst create mode 100644 docs/source/api_reference/django_adminlte2_pdq.rst create mode 100644 docs/source/api_reference/django_adminlte2_pdq.templatetags.admin.rst create mode 100644 docs/source/api_reference/django_adminlte2_pdq.templatetags.rst diff --git a/MANIFEST.in b/MANIFEST.in index f1e4d35..0be42a8 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include LICENSE.md include README.md -recursive-include adminlte2_pdq/static * -recursive-include adminlte2_pdq/templates * -recursive-include docs * \ No newline at end of file +recursive-include django_adminlte2_pdq/static * +recursive-include django_adminlte2_pdq/templates * +recursive-include docs * diff --git a/README.md b/README.md index 751c776..5d30f50 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ The full documentation can be found on [Read The Docs](https://django-adminlte2- 2. Add "adminlte2_pdq" to your INSTALLED_APPS setting like this: ```python INSTALLED_APPS = [ - 'adminlte2_pdq', + 'django_adminlte2_pdq', ... ] ``` @@ -80,7 +80,7 @@ The full documentation can be found on [Read The Docs](https://django-adminlte2- MIDDLEWARE = [ ... - 'adminlte2_pdq.middleware.AuthMiddleware', + 'django_adminlte2_pdq.middleware.AuthMiddleware', ] ``` @@ -120,7 +120,7 @@ The full documentation can be found on [Read The Docs](https://django-adminlte2- urlpatterns = [ # Adminlte2 default routes for demo purposes - path('', include('adminlte2_pdq.urls')), + path('', include('django_adminlte2_pdq.urls')), # Django Account Routes - Styled in AdminLTE2 path('accounts/', include('django.contrib.auth.urls')), # Admin - Styled in Django but hosted in AdminLTE2 layout diff --git a/django_adminlte2_pdq/management/commands/showviews.py b/django_adminlte2_pdq/management/commands/showviews.py index 5ba0951..689be19 100644 --- a/django_adminlte2_pdq/management/commands/showviews.py +++ b/django_adminlte2_pdq/management/commands/showviews.py @@ -12,7 +12,7 @@ from django.conf import settings from django.urls.resolvers import URLPattern, URLResolver # Internal Imports. -from adminlte2_pdq.mixins import ( +from django_adminlte2_pdq.mixins import ( AllowAnonymousAccessMixin, LoginRequiredMixin, AllowWithoutPermissionsMixin, diff --git a/django_adminlte2_pdq/templatetags/admin/admin_menu.py b/django_adminlte2_pdq/templatetags/admin/admin_menu.py index 06c9224..2ac4b83 100644 --- a/django_adminlte2_pdq/templatetags/admin/admin_menu.py +++ b/django_adminlte2_pdq/templatetags/admin/admin_menu.py @@ -3,8 +3,8 @@ from django import template from django.conf import settings -from adminlte2_pdq.menu import MENU -from adminlte2_pdq.admin_menu import AdminMenu +from django_adminlte2_pdq.menu import MENU +from django_adminlte2_pdq.admin_menu import AdminMenu register = template.Library() diff --git a/django_adminlte2_pdq/templatetags/adminlte_tags.py b/django_adminlte2_pdq/templatetags/adminlte_tags.py index c7b7d15..9a9472d 100644 --- a/django_adminlte2_pdq/templatetags/adminlte_tags.py +++ b/django_adminlte2_pdq/templatetags/adminlte_tags.py @@ -12,7 +12,7 @@ from django.conf import settings from django.urls import reverse from django.utils.safestring import mark_safe -from adminlte2_pdq.constants import ( +from django_adminlte2_pdq.constants import ( DATETIME_WIDGET, DATE_WIDGET, TIME_WIDGET, diff --git a/django_adminlte2_pdq/templatetags/sidebar_menu.py b/django_adminlte2_pdq/templatetags/sidebar_menu.py index 92ffbb4..85e738b 100644 --- a/django_adminlte2_pdq/templatetags/sidebar_menu.py +++ b/django_adminlte2_pdq/templatetags/sidebar_menu.py @@ -13,14 +13,14 @@ from django.urls import resolve, reverse, NoReverseMatch from django.utils.module_loading import import_string # Internal Imports. -from adminlte2_pdq.constants import ( +from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, LOGIN_EXEMPT_WHITELIST, STRICT_POLICY, STRICT_POLICY_WHITELIST, ) -from adminlte2_pdq.menu import MENU -from adminlte2_pdq.templatetags.admin.admin_menu import AdminMenu +from django_adminlte2_pdq.menu import MENU +from django_adminlte2_pdq.templatetags.admin.admin_menu import AdminMenu # Template tag registration. diff --git a/docs/generate_docs.sh b/docs/generate_docs.sh index dff8a9a..e34955a 100755 --- a/docs/generate_docs.sh +++ b/docs/generate_docs.sh @@ -28,7 +28,7 @@ mkdir "./source/api_reference" # Auto-generate docs source files, from actual Python code in project. -sphinx-apidoc -f -o ./source/api_reference/ ../adminlte2_pdq/ +sphinx-apidoc -f -o ./source/api_reference/ ../django_adminlte2_pdq/ # Remove modules .rst file, because we don't actually care about it. diff --git a/docs/source/api_reference.rst b/docs/source/api_reference.rst index fb5b2f8..c9c2036 100644 --- a/docs/source/api_reference.rst +++ b/docs/source/api_reference.rst @@ -5,6 +5,6 @@ API Reference :maxdepth: 2 :caption: Contents: - api_reference/adminlte2_pdq - api_reference/adminlte2_pdq.templatetags.admin - api_reference/adminlte2_pdq.templatetags + api_reference/django_adminlte2_pdq + api_reference/django_adminlte2_pdq.templatetags.admin + api_reference/django_adminlte2_pdq.templatetags diff --git a/docs/source/api_reference/adminlte2_pdq.rst b/docs/source/api_reference/adminlte2_pdq.rst deleted file mode 100644 index 7ac8d3d..0000000 --- a/docs/source/api_reference/adminlte2_pdq.rst +++ /dev/null @@ -1,101 +0,0 @@ -adminlte2\_pdq package -====================== - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - adminlte2_pdq.templatetags - -Submodules ----------- - -adminlte2\_pdq.admin\_menu module ---------------------------------- - -.. automodule:: adminlte2_pdq.admin_menu - :members: - :undoc-members: - :show-inheritance: - -adminlte2\_pdq.constants module -------------------------------- - -.. automodule:: adminlte2_pdq.constants - :members: - :undoc-members: - :show-inheritance: - -adminlte2\_pdq.decorators module --------------------------------- - -.. automodule:: adminlte2_pdq.decorators - :members: - :undoc-members: - :show-inheritance: - -adminlte2\_pdq.forms module ---------------------------- - -.. automodule:: adminlte2_pdq.forms - :members: - :undoc-members: - :show-inheritance: - -adminlte2\_pdq.menu module --------------------------- - -.. automodule:: adminlte2_pdq.menu - :members: - :undoc-members: - :show-inheritance: - -adminlte2\_pdq.middleware module --------------------------------- - -.. automodule:: adminlte2_pdq.middleware - :members: - :undoc-members: - :show-inheritance: - -adminlte2\_pdq.mixins module ----------------------------- - -.. automodule:: adminlte2_pdq.mixins - :members: - :undoc-members: - :show-inheritance: - -adminlte2\_pdq.urls module --------------------------- - -.. automodule:: adminlte2_pdq.urls - :members: - :undoc-members: - :show-inheritance: - -adminlte2\_pdq.utils module ---------------------------- - -.. automodule:: adminlte2_pdq.utils - :members: - :undoc-members: - :show-inheritance: - -adminlte2\_pdq.views module ---------------------------- - -.. automodule:: adminlte2_pdq.views - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: adminlte2_pdq - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api_reference/adminlte2_pdq.templatetags.admin.rst b/docs/source/api_reference/adminlte2_pdq.templatetags.admin.rst deleted file mode 100644 index 9d41da8..0000000 --- a/docs/source/api_reference/adminlte2_pdq.templatetags.admin.rst +++ /dev/null @@ -1,45 +0,0 @@ -adminlte2\_pdq.templatetags.admin package -========================================= - -Submodules ----------- - -adminlte2\_pdq.templatetags.admin.admin\_control\_sidebar module ----------------------------------------------------------------- - -.. automodule:: adminlte2_pdq.templatetags.admin.admin_control_sidebar - :members: - :undoc-members: - :show-inheritance: - -adminlte2\_pdq.templatetags.admin.admin\_header module ------------------------------------------------------- - -.. automodule:: adminlte2_pdq.templatetags.admin.admin_header - :members: - :undoc-members: - :show-inheritance: - -adminlte2\_pdq.templatetags.admin.admin\_index module ------------------------------------------------------ - -.. automodule:: adminlte2_pdq.templatetags.admin.admin_index - :members: - :undoc-members: - :show-inheritance: - -adminlte2\_pdq.templatetags.admin.admin\_menu module ----------------------------------------------------- - -.. automodule:: adminlte2_pdq.templatetags.admin.admin_menu - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: adminlte2_pdq.templatetags.admin - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api_reference/adminlte2_pdq.templatetags.rst b/docs/source/api_reference/adminlte2_pdq.templatetags.rst deleted file mode 100644 index 3778109..0000000 --- a/docs/source/api_reference/adminlte2_pdq.templatetags.rst +++ /dev/null @@ -1,45 +0,0 @@ -adminlte2\_pdq.templatetags package -=================================== - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - adminlte2_pdq.templatetags.admin - -Submodules ----------- - -adminlte2\_pdq.templatetags.adminlte\_filters module ----------------------------------------------------- - -.. automodule:: adminlte2_pdq.templatetags.adminlte_filters - :members: - :undoc-members: - :show-inheritance: - -adminlte2\_pdq.templatetags.adminlte\_tags module -------------------------------------------------- - -.. automodule:: adminlte2_pdq.templatetags.adminlte_tags - :members: - :undoc-members: - :show-inheritance: - -adminlte2\_pdq.templatetags.sidebar\_menu module ------------------------------------------------- - -.. automodule:: adminlte2_pdq.templatetags.sidebar_menu - :members: - :undoc-members: - :show-inheritance: - -Module contents ---------------- - -.. automodule:: adminlte2_pdq.templatetags - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/api_reference/django_adminlte2_pdq.management.commands.rst b/docs/source/api_reference/django_adminlte2_pdq.management.commands.rst new file mode 100644 index 0000000..d5c95bb --- /dev/null +++ b/docs/source/api_reference/django_adminlte2_pdq.management.commands.rst @@ -0,0 +1,37 @@ +django\_adminlte2\_pdq.management.commands package +================================================== + +Submodules +---------- + +django\_adminlte2\_pdq.management.commands.showperms module +----------------------------------------------------------- + +.. automodule:: django_adminlte2_pdq.management.commands.showperms + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.management.commands.showroutes module +------------------------------------------------------------ + +.. automodule:: django_adminlte2_pdq.management.commands.showroutes + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.management.commands.showviews module +----------------------------------------------------------- + +.. automodule:: django_adminlte2_pdq.management.commands.showviews + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: django_adminlte2_pdq.management.commands + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/api_reference/django_adminlte2_pdq.management.rst b/docs/source/api_reference/django_adminlte2_pdq.management.rst new file mode 100644 index 0000000..38615ea --- /dev/null +++ b/docs/source/api_reference/django_adminlte2_pdq.management.rst @@ -0,0 +1,18 @@ +django\_adminlte2\_pdq.management package +========================================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + django_adminlte2_pdq.management.commands + +Module contents +--------------- + +.. automodule:: django_adminlte2_pdq.management + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/api_reference/django_adminlte2_pdq.rst b/docs/source/api_reference/django_adminlte2_pdq.rst new file mode 100644 index 0000000..f2be5fe --- /dev/null +++ b/docs/source/api_reference/django_adminlte2_pdq.rst @@ -0,0 +1,102 @@ +django\_adminlte2\_pdq package +============================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + django_adminlte2_pdq.management + django_adminlte2_pdq.templatetags + +Submodules +---------- + +django\_adminlte2\_pdq.admin\_menu module +----------------------------------------- + +.. automodule:: django_adminlte2_pdq.admin_menu + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.constants module +--------------------------------------- + +.. automodule:: django_adminlte2_pdq.constants + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.decorators module +---------------------------------------- + +.. automodule:: django_adminlte2_pdq.decorators + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.forms module +----------------------------------- + +.. automodule:: django_adminlte2_pdq.forms + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.menu module +---------------------------------- + +.. automodule:: django_adminlte2_pdq.menu + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.middleware module +---------------------------------------- + +.. automodule:: django_adminlte2_pdq.middleware + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.mixins module +------------------------------------ + +.. automodule:: django_adminlte2_pdq.mixins + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.urls module +---------------------------------- + +.. automodule:: django_adminlte2_pdq.urls + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.utils module +----------------------------------- + +.. automodule:: django_adminlte2_pdq.utils + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.views module +----------------------------------- + +.. automodule:: django_adminlte2_pdq.views + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: django_adminlte2_pdq + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/api_reference/django_adminlte2_pdq.templatetags.admin.rst b/docs/source/api_reference/django_adminlte2_pdq.templatetags.admin.rst new file mode 100644 index 0000000..61a7d7a --- /dev/null +++ b/docs/source/api_reference/django_adminlte2_pdq.templatetags.admin.rst @@ -0,0 +1,45 @@ +django\_adminlte2\_pdq.templatetags.admin package +================================================= + +Submodules +---------- + +django\_adminlte2\_pdq.templatetags.admin.admin\_control\_sidebar module +------------------------------------------------------------------------ + +.. automodule:: django_adminlte2_pdq.templatetags.admin.admin_control_sidebar + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.templatetags.admin.admin\_header module +-------------------------------------------------------------- + +.. automodule:: django_adminlte2_pdq.templatetags.admin.admin_header + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.templatetags.admin.admin\_index module +------------------------------------------------------------- + +.. automodule:: django_adminlte2_pdq.templatetags.admin.admin_index + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.templatetags.admin.admin\_menu module +------------------------------------------------------------ + +.. automodule:: django_adminlte2_pdq.templatetags.admin.admin_menu + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: django_adminlte2_pdq.templatetags.admin + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/api_reference/django_adminlte2_pdq.templatetags.rst b/docs/source/api_reference/django_adminlte2_pdq.templatetags.rst new file mode 100644 index 0000000..0ab997b --- /dev/null +++ b/docs/source/api_reference/django_adminlte2_pdq.templatetags.rst @@ -0,0 +1,45 @@ +django\_adminlte2\_pdq.templatetags package +=========================================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + django_adminlte2_pdq.templatetags.admin + +Submodules +---------- + +django\_adminlte2\_pdq.templatetags.adminlte\_filters module +------------------------------------------------------------ + +.. automodule:: django_adminlte2_pdq.templatetags.adminlte_filters + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.templatetags.adminlte\_tags module +--------------------------------------------------------- + +.. automodule:: django_adminlte2_pdq.templatetags.adminlte_tags + :members: + :undoc-members: + :show-inheritance: + +django\_adminlte2\_pdq.templatetags.sidebar\_menu module +-------------------------------------------------------- + +.. automodule:: django_adminlte2_pdq.templatetags.sidebar_menu + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: django_adminlte2_pdq.templatetags + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/authorization/class_views.rst b/docs/source/authorization/class_views.rst index f638ab1..c316432 100644 --- a/docs/source/authorization/class_views.rst +++ b/docs/source/authorization/class_views.rst @@ -17,13 +17,13 @@ Those mixins are: .. code:: python - from adminlte2_pdq.mixins import LoginRequiredMixin + from django_adminlte2_pdq.mixins import LoginRequiredMixin * :ref:`authorization/class_views:permission required mixin` imported with .. code:: python - from adminlte2_pdq.mixins import PermissionRequiredMixin + from django_adminlte2_pdq.mixins import PermissionRequiredMixin Login Required Mixin @@ -44,7 +44,7 @@ they will see the sidebar link and have access. .. code:: python - from adminlte2_pdq.mixins import LoginRequiredMixin + from django_adminlte2_pdq.mixins import LoginRequiredMixin class DemoCss(LoginRequiredMixin, View): """Show examples of extra-features.css""" @@ -77,7 +77,7 @@ Permission Required Attribute .. code:: python - from adminlte2_pdq.mixins import PermissionRequiredMixin + from django_adminlte2_pdq.mixins import PermissionRequiredMixin class Sample1(PermissionRequiredMixin, View): """Show sample1 page""" @@ -111,7 +111,7 @@ Permission Required One Attribute .. code:: python - from adminlte2_pdq.mixins import PermissionRequiredMixin + from django_adminlte2_pdq.mixins import PermissionRequiredMixin class Sample2(PermissionRequiredMixin, View): """Show sample2 page""" @@ -234,7 +234,7 @@ permissions at first, then show how to correct it. The views are as follows: from django.shortcuts import render from django.views import View - from adminlte2_pdq.mixins import ( + from django_adminlte2_pdq.mixins import ( LoginRequiredMixin, PermissionRequiredMixin, ) @@ -465,7 +465,7 @@ follows: from django.shortcuts import render from django.views import View - from adminlte2_pdq.mixins import ( + from django_adminlte2_pdq.mixins import ( LoginRequiredMixin, PermissionRequiredMixin, ) diff --git a/docs/source/authorization/function_views.rst b/docs/source/authorization/function_views.rst index 5da4d83..a71a9da 100644 --- a/docs/source/authorization/function_views.rst +++ b/docs/source/authorization/function_views.rst @@ -17,21 +17,21 @@ Those decorators are: .. code:: python - from adminlte2_pdq.decorators import login_required + from django_adminlte2_pdq.decorators import login_required * :ref:`authorization/function_views:permission required decorator` imported with .. code:: python - from adminlte2_pdq.decorators import permission_required + from django_adminlte2_pdq.decorators import permission_required * :ref:`authorization/function_views:permission required one decorator` imported with .. code:: python - from adminlte2_pdq.decorators import permission_required_one + from django_adminlte2_pdq.decorators import permission_required_one Login Required Decorator @@ -52,7 +52,7 @@ they will see the sidebar link and have access. .. code:: python - from adminlte2_pdq.decorators import login_required + from django_adminlte2_pdq.decorators import login_required @login_required def demo_css(request): @@ -80,7 +80,7 @@ sidebar link and have access. .. code:: python - from adminlte2_pdq.decorators import permission_required + from django_adminlte2_pdq.decorators import permission_required @permission_required([ 'auth.add_group', @@ -121,7 +121,7 @@ permissions, they will see the sidebar link and have access. .. code:: python - from adminlte2_pdq.decorators import permission_required_one + from django_adminlte2_pdq.decorators import permission_required_one @permission_required_one([ 'auth.add_permission', @@ -240,7 +240,7 @@ Below is all the code required to generate these views. .. code:: python from django.shortcuts import render - from adminlte2_pdq.decorators import ( + from django_adminlte2_pdq.decorators import ( login_required, permission_required, permission_required_one, @@ -462,7 +462,7 @@ Below is all the code required to generate these views. .. code:: python from django.shortcuts import render - from adminlte2_pdq.decorators import ( + from django_adminlte2_pdq.decorators import ( login_required, permission_required, permission_required_one, diff --git a/docs/source/conf.py b/docs/source/conf.py index d5f2c48..a48e7d8 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -19,7 +19,7 @@ sys.path.insert(0, os.path.abspath("../..")) # Allow reading Django files/syntax, in order to generate docs from them. import django from django.conf import settings -from adminlte2_pdq import __version__ +from django_adminlte2_pdq import __version__ # -- Project information ----------------------------------------------------- @@ -84,7 +84,7 @@ html_static_path = [] settings.configure( SECRET_KEY="something-to-make-Django-happy", INSTALLED_APPS=[ - "adminlte2_pdq", + "django_adminlte2_pdq", "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", diff --git a/docs/source/demo_css.rst b/docs/source/demo_css.rst index 62cef56..112ebee 100644 --- a/docs/source/demo_css.rst +++ b/docs/source/demo_css.rst @@ -9,7 +9,7 @@ Assuming you are including the default routes that come with this package .. code:: python - path('', include('adminlte2_pdq.urls')), + path('', include('django_adminlte2_pdq.urls')), You can go to ``<domain>/demo-css`` to see this page. From there you can inspect any element using your favorite browser to see which classes are diff --git a/docs/source/menu/admin.rst b/docs/source/menu/admin.rst index e92e16f..f8f77d8 100644 --- a/docs/source/menu/admin.rst +++ b/docs/source/menu/admin.rst @@ -39,7 +39,7 @@ have their icons updated to be something more useful. .. code:: python - from adminlte2_pdq.admin_menu import AdminMenu + from django_adminlte2_pdq.admin_menu import AdminMenu ... @@ -75,7 +75,7 @@ the ``admin.py`` file in our example Blog app. .. code:: python - from adminlte2_pdq.admin_menu import AdminMenu + from django_adminlte2_pdq.admin_menu import AdminMenu ... @@ -102,7 +102,7 @@ In any ``admin.py`` file, call one additional method on the .. code:: python - from adminlte2_pdq.admin_menu import AdminMenu + from django_adminlte2_pdq.admin_menu import AdminMenu ... diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst index 77a6784..1ba23f1 100644 --- a/docs/source/quickstart.rst +++ b/docs/source/quickstart.rst @@ -13,7 +13,7 @@ Quickstart .. code-block:: python INSTALLED_APPS = [ - 'adminlte2_pdq', + 'django_adminlte2_pdq', ... ] @@ -41,7 +41,7 @@ Quickstart MIDDLEWARE = [ ... - 'adminlte2_pdq.middleware.AuthMiddleware', + 'django_adminlte2_pdq.middleware.AuthMiddleware', ] .. note:: @@ -78,7 +78,7 @@ Quickstart urlpatterns = [ # Adminlte2 default routes for demo purposes - path('', include('adminlte2_pdq.urls')), + path('', include('django_adminlte2_pdq.urls')), # Django Account Routes - Styled in AdminLTE2 path('accounts/', include('django.contrib.auth.urls')), # Admin - Styled in Django but hosted in AdminLTE2 layout diff --git a/tests/settings.py b/tests/settings.py index 3d925d7..de4a641 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -18,7 +18,7 @@ DATABASES = { INSTALLED_APPS = ( - "adminlte2_pdq", + "django_adminlte2_pdq", "tests", "django.contrib.admin", "django.contrib.auth", @@ -37,7 +37,7 @@ MIDDLEWARE = [ "django.contrib.auth.middleware.AuthenticationMiddleware", "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", - "adminlte2_pdq.middleware.AuthMiddleware", + "django_adminlte2_pdq.middleware.AuthMiddleware", ] diff --git a/tests/tests/test_decorators/base_test_case.py b/tests/tests/test_decorators/base_test_case.py index 1c30e20..e16564f 100644 --- a/tests/tests/test_decorators/base_test_case.py +++ b/tests/tests/test_decorators/base_test_case.py @@ -14,8 +14,8 @@ from django.test import RequestFactory, TestCase from django_expanded_test_cases import IntegrationTestCase # Internal Imports. -from adminlte2_pdq.constants import LOGIN_EXEMPT_WHITELIST, STRICT_POLICY_WHITELIST -from adminlte2_pdq.decorators import login_required, permission_required, permission_required_one +from django_adminlte2_pdq.constants import LOGIN_EXEMPT_WHITELIST, STRICT_POLICY_WHITELIST +from django_adminlte2_pdq.decorators import login_required, permission_required, permission_required_one # Module Variables. diff --git a/tests/tests/test_decorators/test_isolated_decorators.py b/tests/tests/test_decorators/test_isolated_decorators.py index 36c7dec..ae7d352 100644 --- a/tests/tests/test_decorators/test_isolated_decorators.py +++ b/tests/tests/test_decorators/test_isolated_decorators.py @@ -13,8 +13,8 @@ from django.http import HttpResponse from django.test import RequestFactory, TestCase # Internal Imports. -from adminlte2_pdq.constants import LOGIN_EXEMPT_WHITELIST, STRICT_POLICY_WHITELIST -from adminlte2_pdq.decorators import ( +from django_adminlte2_pdq.constants import LOGIN_EXEMPT_WHITELIST, STRICT_POLICY_WHITELIST +from django_adminlte2_pdq.decorators import ( allow_anonymous_access, login_required, allow_without_permissions, diff --git a/tests/tests/test_decorators/test_login_required_mode.py b/tests/tests/test_decorators/test_login_required_mode.py index ed2fe2a..ae6b2d5 100644 --- a/tests/tests/test_decorators/test_login_required_mode.py +++ b/tests/tests/test_decorators/test_login_required_mode.py @@ -1143,8 +1143,8 @@ class LoginModeMixin: @override_settings(DEBUG=True) @override_settings(ADMINLTE2_USE_LOGIN_REQUIRED=True) @override_settings(LOGIN_REQUIRED=True) -@patch("adminlte2_pdq.constants.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.constants.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) class TestLoginRequiredAuthenticationDecorators(BaseDecoratorTestCase, LoginModeMixin): """Runtime test execution of decorators under "Login Required" mode.""" @@ -1158,7 +1158,7 @@ class TestLoginRequiredAuthenticationDecorators(BaseDecoratorTestCase, LoginMode self.assertEqual(0, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, @@ -1176,10 +1176,10 @@ class TestLoginRequiredAuthenticationDecorators(BaseDecoratorTestCase, LoginMode @override_settings(LOGIN_REQUIRED=True) @override_settings(ADMINLTE2_LOGIN_EXEMPT_WHITELIST=LOGIN_WHITELIST_VIEWS) @override_settings(LOGIN_EXEMPT_WHITELIST=LOGIN_WHITELIST_VIEWS) -@patch("adminlte2_pdq.constants.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.constants.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) -@patch("adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.constants.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.constants.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) class TestLoginRequiredAuthenticationDecoratorsWithLoginWhitelist(BaseDecoratorTestCase, LoginModeMixin): """Runtime test execution of decorators under "Login Required" mode, with whitelist set for views. @@ -1204,7 +1204,7 @@ class TestLoginRequiredAuthenticationDecoratorsWithLoginWhitelist(BaseDecoratorT self.assertEqual(0, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, diff --git a/tests/tests/test_decorators/test_loose_mode.py b/tests/tests/test_decorators/test_loose_mode.py index bc12bce..15635ef 100644 --- a/tests/tests/test_decorators/test_loose_mode.py +++ b/tests/tests/test_decorators/test_loose_mode.py @@ -17,8 +17,8 @@ from .base_test_case import BaseDecoratorTestCase @override_settings(DEBUG=True) @override_settings(ADMINLTE2_USE_STRICT_POLICY=False) @override_settings(STRICT_POLICY=False) -@patch("adminlte2_pdq.constants.STRICT_POLICY", False) -@patch("adminlte2_pdq.middleware.STRICT_POLICY", False) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY", False) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY", False) class TestLooseAuthenticationDecorators(BaseDecoratorTestCase): """ Test project authentication decorators, under project "Loose" mode. @@ -34,7 +34,7 @@ class TestLooseAuthenticationDecorators(BaseDecoratorTestCase): self.assertEqual(0, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, diff --git a/tests/tests/test_decorators/test_strict_mode.py b/tests/tests/test_decorators/test_strict_mode.py index 44538a5..5b3d3c0 100644 --- a/tests/tests/test_decorators/test_strict_mode.py +++ b/tests/tests/test_decorators/test_strict_mode.py @@ -1548,10 +1548,10 @@ class StrictModeMixin: @override_settings(LOGIN_REQUIRED=True) @override_settings(ADMINLTE2_USE_STRICT_POLICY=True) @override_settings(STRICT_POLICY=True) -@patch("adminlte2_pdq.constants.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.constants.STRICT_POLICY", True) -@patch("adminlte2_pdq.middleware.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.constants.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY", True) class TestStrictAuthenticationDecorators(BaseDecoratorTestCase, StrictModeMixin): """Runtime test execution of decorators under "Strict" mode.""" @@ -1565,7 +1565,7 @@ class TestStrictAuthenticationDecorators(BaseDecoratorTestCase, StrictModeMixin) self.assertEqual(0, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, @@ -1585,12 +1585,12 @@ class TestStrictAuthenticationDecorators(BaseDecoratorTestCase, StrictModeMixin) @override_settings(STRICT_POLICY=True) @override_settings(ADMINLTE2_LOGIN_EXEMPT_WHITELIST=LOGIN_WHITELIST_VIEWS) @override_settings(LOGIN_EXEMPT_WHITELIST=LOGIN_WHITELIST_VIEWS) -@patch("adminlte2_pdq.constants.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.constants.STRICT_POLICY", True) -@patch("adminlte2_pdq.middleware.STRICT_POLICY", True) -@patch("adminlte2_pdq.constants.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) -@patch("adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.constants.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.constants.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) class TestStrictAuthenticationDecoratorsWithLoginWhitelist(BaseDecoratorTestCase, StrictModeMixin): """Runtime test execution of decorators under "Strict" mode, with login whitelist set for views. @@ -1615,7 +1615,7 @@ class TestStrictAuthenticationDecoratorsWithLoginWhitelist(BaseDecoratorTestCase self.assertEqual(0, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, @@ -3393,12 +3393,12 @@ class TestStrictAuthenticationDecoratorsWithLoginWhitelist(BaseDecoratorTestCase @override_settings(STRICT_POLICY=True) @override_settings(ADMINLTE2_STRICT_POLICY_WHITELIST=PERM_WHITELIST_VIEWS) @override_settings(STRICT_POLICY_WHITELIST=PERM_WHITELIST_VIEWS) -@patch("adminlte2_pdq.constants.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.constants.STRICT_POLICY", True) -@patch("adminlte2_pdq.middleware.STRICT_POLICY", True) -@patch("adminlte2_pdq.constants.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) -@patch("adminlte2_pdq.middleware.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.constants.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) class TestStrictAuthenticationDecoratorsWithPermWhitelist(BaseDecoratorTestCase, StrictModeMixin): """Runtime test execution of decorators under "Strict" mode, with permission whitelist set for views. @@ -3419,7 +3419,7 @@ class TestStrictAuthenticationDecoratorsWithPermWhitelist(BaseDecoratorTestCase, self.assertEqual(16, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, @@ -4187,14 +4187,14 @@ class TestStrictAuthenticationDecoratorsWithPermWhitelist(BaseDecoratorTestCase, @override_settings(LOGIN_EXEMPT_WHITELIST=LOGIN_WHITELIST_VIEWS) @override_settings(ADMINLTE2_STRICT_POLICY_WHITELIST=PERM_WHITELIST_VIEWS) @override_settings(STRICT_POLICY_WHITELIST=PERM_WHITELIST_VIEWS) -@patch("adminlte2_pdq.constants.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.constants.STRICT_POLICY", True) -@patch("adminlte2_pdq.middleware.STRICT_POLICY", True) -@patch("adminlte2_pdq.constants.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) -@patch("adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) -@patch("adminlte2_pdq.constants.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) -@patch("adminlte2_pdq.middleware.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.constants.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.constants.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) class TestStrictAuthenticationDecoratorsWithBothWhitelists(BaseDecoratorTestCase, StrictModeMixin): """Runtime test execution of decorators under "Strict" mode, with both whitelists set for views. @@ -4214,7 +4214,7 @@ class TestStrictAuthenticationDecoratorsWithBothWhitelists(BaseDecoratorTestCase self.assertEqual(16, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, @@ -4387,10 +4387,10 @@ class TestStrictAuthenticationDecoratorsWithBothWhitelists(BaseDecoratorTestCase @override_settings(LOGIN_REQUIRED=True) @override_settings(ADMINLTE2_USE_STRICT_POLICY=True) @override_settings(STRICT_POLICY=True) -@patch("adminlte2_pdq.constants.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.constants.STRICT_POLICY", True) -@patch("adminlte2_pdq.middleware.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.constants.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY", True) class TestStrictAutAuthenticationMixinsWithOverlap(BaseDecoratorTestCase): """Tests for overlapping decorator use. diff --git a/tests/tests/test_middleware.py b/tests/tests/test_middleware.py index e8db4c6..277c058 100644 --- a/tests/tests/test_middleware.py +++ b/tests/tests/test_middleware.py @@ -14,7 +14,7 @@ from django.urls import reverse from pytest import warns # Internal Imports. -from adminlte2_pdq.constants import LOGIN_EXEMPT_WHITELIST, STRICT_POLICY_WHITELIST +from django_adminlte2_pdq.constants import LOGIN_EXEMPT_WHITELIST, STRICT_POLICY_WHITELIST # Module Variables. @@ -92,7 +92,7 @@ class StandardMiddlewareTestCase(MiddlewareBaseTestCase): @override_settings(DEBUG=True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) class LoginRequiredMiddlewareTestCase(MiddlewareBaseTestCase): """Test Middleware handling when in "LOGIN_REQUIRED" authentication mode.""" @@ -102,7 +102,7 @@ class LoginRequiredMiddlewareTestCase(MiddlewareBaseTestCase): # Verify values imported from middleware file. # We don't use constants.py values because the above settings techncially don't override such. # Plus this test is a middleware test so it's probably fine. - from adminlte2_pdq.middleware import ( + from django_adminlte2_pdq.middleware import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, @@ -138,7 +138,7 @@ class LoginRequiredMiddlewareTestCase(MiddlewareBaseTestCase): self.assertEqual(response.status_code, 200) self.assertContains(response, "<h1>Demo CSS</h1>") - @patch("adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", UPDATED_LOGIN_EXEMPT_WHITELIST) + @patch("django_adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", UPDATED_LOGIN_EXEMPT_WHITELIST) def test__with_login_whitelist(self): """Test when "LOGIN_REQUIRED" mode and login whitelist is set.""" @@ -167,8 +167,8 @@ class LoginRequiredMiddlewareTestCase(MiddlewareBaseTestCase): # TODO: Even though the value in constants should always set LOGIN_REQUIRED = True when in STRICT mode, # this patch doesn't seem to. Not sure if there's a better way to handle overriding the settings. @override_settings(DEBUG=True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY", True) class StrictMiddlewareTestCase(MiddlewareBaseTestCase): """Test Middleware handling when in "STRICT" authentication mode.""" @@ -178,7 +178,7 @@ class StrictMiddlewareTestCase(MiddlewareBaseTestCase): # Verify values imported from middleware file. # We don't use constants.py values because the above settings technically don't override such. # Plus this test is a middleware test so it's probably fine. - from adminlte2_pdq.middleware import ( + from django_adminlte2_pdq.middleware import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, @@ -247,7 +247,7 @@ class StrictMiddlewareTestCase(MiddlewareBaseTestCase): self.assertEqual(response.status_code, 200) self.assertContains(response, "Home") - @patch("adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", UPDATED_LOGIN_EXEMPT_WHITELIST) + @patch("django_adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", UPDATED_LOGIN_EXEMPT_WHITELIST) def test__with_login_whitelist(self): """Test when "STRICT" mode and login whitelist is set.""" @@ -295,7 +295,7 @@ class StrictMiddlewareTestCase(MiddlewareBaseTestCase): # Assert warnings match. self.assertEqual(expected_warns, actual_warns) - @patch("adminlte2_pdq.middleware.STRICT_POLICY_WHITELIST", UPDATED_STRICT_POLICY_WHITELIST) + @patch("django_adminlte2_pdq.middleware.STRICT_POLICY_WHITELIST", UPDATED_STRICT_POLICY_WHITELIST) def test__with_permission_whitelist(self): """Test when "STRICT" mode and permission whitelist is set.""" @@ -320,8 +320,8 @@ class StrictMiddlewareTestCase(MiddlewareBaseTestCase): self.assertEqual(response.status_code, 200) self.assertContains(response, "<h1>Demo CSS</h1>") - @patch("adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", UPDATED_LOGIN_EXEMPT_WHITELIST) - @patch("adminlte2_pdq.middleware.STRICT_POLICY_WHITELIST", UPDATED_STRICT_POLICY_WHITELIST) + @patch("django_adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", UPDATED_LOGIN_EXEMPT_WHITELIST) + @patch("django_adminlte2_pdq.middleware.STRICT_POLICY_WHITELIST", UPDATED_STRICT_POLICY_WHITELIST) def test__with_both_whitelists(self): """Test when "STRICT" mode and both whitelists are set.""" @@ -346,7 +346,7 @@ class StrictMiddlewareTestCase(MiddlewareBaseTestCase): self.assertEqual(response.status_code, 200) self.assertContains(response, "<h1>Demo CSS</h1>") - @patch("adminlte2_pdq.middleware.MEDIA_ROUTE", "/") # Pretend the root url is a media file. + @patch("django_adminlte2_pdq.middleware.MEDIA_ROUTE", "/") # Pretend the root url is a media file. def test__no_whitelists_and_home_page_is_media_route(self): # MEDIA_URL should not be allowed to be the root of a website, thus can not skip the login required check. @@ -360,7 +360,7 @@ class StrictMiddlewareTestCase(MiddlewareBaseTestCase): self.assertEqual(response.status_code, 200) self.assertContains(response, "Login") - @patch("adminlte2_pdq.middleware.MEDIA_ROUTE", "/demo-css/") # Pretend the demo-css route is a media file. + @patch("django_adminlte2_pdq.middleware.MEDIA_ROUTE", "/demo-css/") # Pretend the demo-css route is a media file. def test__no_whitelists_and_misc_page_is_media_route(self): with self.subTest("As anonymous user"): @@ -371,7 +371,7 @@ class StrictMiddlewareTestCase(MiddlewareBaseTestCase): self.assertEqual(response.status_code, 200) self.assertContains(response, "<h1>Demo CSS</h1>") - @patch("adminlte2_pdq.middleware.WEBSOCKET_ROUTE", "/") # Pretend the root url is a websocket file. + @patch("django_adminlte2_pdq.middleware.WEBSOCKET_ROUTE", "/") # Pretend the root url is a websocket file. def test__no_whitelists_and_home_page_is_websocket_route(self): # WEBSOCKET_URL should not be allowed to be the root of a website, thus can not skip the login required check. @@ -385,7 +385,9 @@ class StrictMiddlewareTestCase(MiddlewareBaseTestCase): self.assertEqual(response.status_code, 200) self.assertContains(response, "Login") - @patch("adminlte2_pdq.middleware.WEBSOCKET_ROUTE", "/demo-css/") # Pretend the demo-css route is a websocket file. + @patch( + "django_adminlte2_pdq.middleware.WEBSOCKET_ROUTE", "/demo-css/" + ) # Pretend the demo-css route is a websocket file. def test__no_whitelists_and_misc_page_is_websocket_route(self): with self.subTest("As anonymous user"): diff --git a/tests/tests/test_mixins/base_test_case.py b/tests/tests/test_mixins/base_test_case.py index 8629bea..ea218cd 100644 --- a/tests/tests/test_mixins/base_test_case.py +++ b/tests/tests/test_mixins/base_test_case.py @@ -15,8 +15,8 @@ from django.views import View from django_expanded_test_cases import IntegrationTestCase # Internal Imports. -from adminlte2_pdq.constants import LOGIN_EXEMPT_WHITELIST, STRICT_POLICY_WHITELIST -from adminlte2_pdq.mixins import LoginRequiredMixin, PermissionRequiredMixin +from django_adminlte2_pdq.constants import LOGIN_EXEMPT_WHITELIST, STRICT_POLICY_WHITELIST +from django_adminlte2_pdq.mixins import LoginRequiredMixin, PermissionRequiredMixin # Module Variables. diff --git a/tests/tests/test_mixins/test_isolated_mixins.py b/tests/tests/test_mixins/test_isolated_mixins.py index 08c4abd..ec5ee73 100644 --- a/tests/tests/test_mixins/test_isolated_mixins.py +++ b/tests/tests/test_mixins/test_isolated_mixins.py @@ -15,8 +15,8 @@ from django.views import View from django_expanded_test_cases import IntegrationTestCase # Internal Imports. -from adminlte2_pdq.constants import LOGIN_EXEMPT_WHITELIST, STRICT_POLICY_WHITELIST -from adminlte2_pdq.mixins import ( +from django_adminlte2_pdq.constants import LOGIN_EXEMPT_WHITELIST, STRICT_POLICY_WHITELIST +from django_adminlte2_pdq.mixins import ( AllowAnonymousAccessMixin, LoginRequiredMixin, AllowWithoutPermissionsMixin, diff --git a/tests/tests/test_mixins/test_login_required_mode.py b/tests/tests/test_mixins/test_login_required_mode.py index 5aea991..d0740ea 100644 --- a/tests/tests/test_mixins/test_login_required_mode.py +++ b/tests/tests/test_mixins/test_login_required_mode.py @@ -1135,8 +1135,8 @@ class LoginModeMixin: @override_settings(DEBUG=True) @override_settings(ADMINLTE2_USE_LOGIN_REQUIRED=True) @override_settings(LOGIN_REQUIRED=True) -@patch("adminlte2_pdq.constants.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.constants.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) class TestLoginRequiredAuthenticationMixins(BaseMixinTextCase, LoginModeMixin): """Runtime test execution of mixins under "Login Required" mode.""" @@ -1150,7 +1150,7 @@ class TestLoginRequiredAuthenticationMixins(BaseMixinTextCase, LoginModeMixin): self.assertEqual(0, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, @@ -1168,10 +1168,10 @@ class TestLoginRequiredAuthenticationMixins(BaseMixinTextCase, LoginModeMixin): @override_settings(LOGIN_REQUIRED=True) @override_settings(ADMINLTE2_LOGIN_EXEMPT_WHITELIST=LOGIN_WHITELIST_VIEWS) @override_settings(LOGIN_EXEMPT_WHITELIST=LOGIN_WHITELIST_VIEWS) -@patch("adminlte2_pdq.constants.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.constants.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) -@patch("adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.constants.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.constants.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) class TestLoginRequiredAuthenticationMixinsWithLoginWhitelist(BaseMixinTextCase, LoginModeMixin): """Runtime test execution of mixins under "Login Required" mode, with whitelist set for views. @@ -1196,7 +1196,7 @@ class TestLoginRequiredAuthenticationMixinsWithLoginWhitelist(BaseMixinTextCase, self.assertEqual(0, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, diff --git a/tests/tests/test_mixins/test_loose_mode.py b/tests/tests/test_mixins/test_loose_mode.py index 831f629..169c185 100644 --- a/tests/tests/test_mixins/test_loose_mode.py +++ b/tests/tests/test_mixins/test_loose_mode.py @@ -35,7 +35,7 @@ class TestLooseAuthenticationMixins(BaseMixinTextCase): self.assertEqual(0, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, @@ -1200,7 +1200,7 @@ class TestLooseAutAuthenticationMixinsWithLogicBleed(BaseMixinTextCase): self.assertEqual(0, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, diff --git a/tests/tests/test_mixins/test_strict_mode.py b/tests/tests/test_mixins/test_strict_mode.py index 7340a44..2dd5c67 100644 --- a/tests/tests/test_mixins/test_strict_mode.py +++ b/tests/tests/test_mixins/test_strict_mode.py @@ -1539,10 +1539,10 @@ class StrictModeMixin: @override_settings(LOGIN_REQUIRED=True) @override_settings(ADMINLTE2_USE_STRICT_POLICY=True) @override_settings(STRICT_POLICY=True) -@patch("adminlte2_pdq.constants.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.constants.STRICT_POLICY", True) -@patch("adminlte2_pdq.middleware.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.constants.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY", True) class TestStrictAuthenticationMixins(BaseMixinTextCase, StrictModeMixin): """Runtime test execution of mixins under "Strict" mode.""" @@ -1556,7 +1556,7 @@ class TestStrictAuthenticationMixins(BaseMixinTextCase, StrictModeMixin): self.assertEqual(0, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, @@ -1576,12 +1576,12 @@ class TestStrictAuthenticationMixins(BaseMixinTextCase, StrictModeMixin): @override_settings(STRICT_POLICY=True) @override_settings(ADMINLTE2_LOGIN_EXEMPT_WHITELIST=LOGIN_WHITELIST_VIEWS) @override_settings(LOGIN_EXEMPT_WHITELIST=LOGIN_WHITELIST_VIEWS) -@patch("adminlte2_pdq.constants.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.constants.STRICT_POLICY", True) -@patch("adminlte2_pdq.middleware.STRICT_POLICY", True) -@patch("adminlte2_pdq.constants.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) -@patch("adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.constants.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.constants.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) class TestStrictAuthenticationMixinsWithLoginWhitelist(BaseMixinTextCase, StrictModeMixin): """Runtime test execution of mixins under "Strict" mode, with login whitelist set for views. @@ -1603,7 +1603,7 @@ class TestStrictAuthenticationMixinsWithLoginWhitelist(BaseMixinTextCase, Strict self.assertEqual(0, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, @@ -3373,12 +3373,12 @@ class TestStrictAuthenticationMixinsWithLoginWhitelist(BaseMixinTextCase, Strict @override_settings(STRICT_POLICY=True) @override_settings(ADMINLTE2_STRICT_POLICY_WHITELIST=PERM_WHITELIST_VIEWS) @override_settings(STRICT_POLICY_WHITELIST=PERM_WHITELIST_VIEWS) -@patch("adminlte2_pdq.constants.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.constants.STRICT_POLICY", True) -@patch("adminlte2_pdq.middleware.STRICT_POLICY", True) -@patch("adminlte2_pdq.constants.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) -@patch("adminlte2_pdq.middleware.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.constants.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) class TestStrictAuthenticationMixinsWithPermWhitelist(BaseMixinTextCase, StrictModeMixin): """Runtime test execution of mixins under "Strict" mode, with login whitelist set for views. @@ -3399,7 +3399,7 @@ class TestStrictAuthenticationMixinsWithPermWhitelist(BaseMixinTextCase, StrictM self.assertEqual(16, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, @@ -4163,14 +4163,14 @@ class TestStrictAuthenticationMixinsWithPermWhitelist(BaseMixinTextCase, StrictM @override_settings(LOGIN_EXEMPT_WHITELIST=LOGIN_WHITELIST_VIEWS) @override_settings(ADMINLTE2_STRICT_POLICY_WHITELIST=PERM_WHITELIST_VIEWS) @override_settings(STRICT_POLICY_WHITELIST=PERM_WHITELIST_VIEWS) -@patch("adminlte2_pdq.constants.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.constants.STRICT_POLICY", True) -@patch("adminlte2_pdq.middleware.STRICT_POLICY", True) -@patch("adminlte2_pdq.constants.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) -@patch("adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) -@patch("adminlte2_pdq.constants.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) -@patch("adminlte2_pdq.middleware.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.constants.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.constants.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.middleware.LOGIN_EXEMPT_WHITELIST", LOGIN_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY_WHITELIST", PERM_WHITELIST_VIEWS) class TestStrictAuthenticationMixinsWithBothWhitelists(BaseMixinTextCase, StrictModeMixin): """Runtime test execution of mixins under "Strict" mode, with login whitelist set for views. @@ -4190,7 +4190,7 @@ class TestStrictAuthenticationMixinsWithBothWhitelists(BaseMixinTextCase, Strict self.assertEqual(16, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, @@ -4363,10 +4363,10 @@ class TestStrictAuthenticationMixinsWithBothWhitelists(BaseMixinTextCase, Strict @override_settings(LOGIN_REQUIRED=True) @override_settings(ADMINLTE2_USE_STRICT_POLICY=True) @override_settings(STRICT_POLICY=True) -@patch("adminlte2_pdq.constants.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.constants.STRICT_POLICY", True) -@patch("adminlte2_pdq.middleware.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.constants.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY", True) class TestStrictAutAuthenticationMixinsWithLogicBleed(BaseMixinTextCase): """Tests to make sure mixin logic doesn't bleed into each other. @@ -4395,7 +4395,7 @@ class TestStrictAutAuthenticationMixinsWithLogicBleed(BaseMixinTextCase): self.assertEqual(0, len(getattr(settings, "STRICT_POLICY_WHITELIST", []))) # Verify values imported from constants.py file. - from adminlte2_pdq.constants import ( + from django_adminlte2_pdq.constants import ( LOGIN_REQUIRED, STRICT_POLICY, LOGIN_EXEMPT_WHITELIST, @@ -5315,10 +5315,10 @@ class TestStrictAutAuthenticationMixinsWithLogicBleed(BaseMixinTextCase): @override_settings(LOGIN_REQUIRED=True) @override_settings(ADMINLTE2_USE_STRICT_POLICY=True) @override_settings(STRICT_POLICY=True) -@patch("adminlte2_pdq.constants.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.middleware.LOGIN_REQUIRED", True) -@patch("adminlte2_pdq.constants.STRICT_POLICY", True) -@patch("adminlte2_pdq.middleware.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.constants.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.middleware.LOGIN_REQUIRED", True) +@patch("django_adminlte2_pdq.constants.STRICT_POLICY", True) +@patch("django_adminlte2_pdq.middleware.STRICT_POLICY", True) class TestStrictAutAuthenticationMixinsWithOverlap(BaseMixinTextCase): """Tests for overlapping mixin use. diff --git a/tests/tests/test_templatefilters.py b/tests/tests/test_templatefilters.py index 50ad323..d14b1df 100644 --- a/tests/tests/test_templatefilters.py +++ b/tests/tests/test_templatefilters.py @@ -11,7 +11,7 @@ from django.contrib.auth.models import Permission from django.test import TestCase # Internal Imports. -from adminlte2_pdq.templatetags import adminlte_filters +from django_adminlte2_pdq.templatetags import adminlte_filters # Module Variables. diff --git a/tests/tests/test_templatetags.py b/tests/tests/test_templatetags.py index e270180..6a8c329 100644 --- a/tests/tests/test_templatetags.py +++ b/tests/tests/test_templatetags.py @@ -14,7 +14,7 @@ from django.template import Template, Context from django.test import TestCase, override_settings, RequestFactory # Internal Imports. -from adminlte2_pdq.templatetags import adminlte_tags +from django_adminlte2_pdq.templatetags import adminlte_tags # Module Variables. diff --git a/tests/tests/test_templatetags_admin_menu.py b/tests/tests/test_templatetags_admin_menu.py index d3c3761..2d11b97 100644 --- a/tests/tests/test_templatetags_admin_menu.py +++ b/tests/tests/test_templatetags_admin_menu.py @@ -8,7 +8,7 @@ from django.template import Template, Context from django.test import TestCase, RequestFactory, override_settings # Internal Imports. -from adminlte2_pdq.templatetags.admin.admin_menu import AdminMenu +from django_adminlte2_pdq.templatetags.admin.admin_menu import AdminMenu # Module Variables. diff --git a/tests/tests/test_templatetags_sidebar_menu.py b/tests/tests/test_templatetags_sidebar_menu.py index 6303bb8..d49845f 100644 --- a/tests/tests/test_templatetags_sidebar_menu.py +++ b/tests/tests/test_templatetags_sidebar_menu.py @@ -15,7 +15,7 @@ from django.test import TestCase, override_settings, RequestFactory from django.urls import NoReverseMatch # Internal Imports. -from adminlte2_pdq.templatetags import sidebar_menu +from django_adminlte2_pdq.templatetags import sidebar_menu # Module Variables. @@ -875,7 +875,7 @@ class TemplateTagSidebarMenuTestCase(TemplateTagSidebarMenuBaseTestCase): self.assertFalse(is_whitelisted) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:sample_form"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:sample_form"]) def test__check_for_login_whitelisted_node__node_in_list(self): node = { "route": "adminlte2_pdq:sample_form", @@ -902,7 +902,7 @@ class TemplateTagSidebarMenuTestCase(TemplateTagSidebarMenuBaseTestCase): self.assertFalse(is_whitelisted) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:sample2"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:sample2"]) def test__check_for_strict_whitelisted_node__node_in_list(self): node = { "route": "adminlte2_pdq:sample2", @@ -2372,7 +2372,7 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes # region LoginRequired Mode, No Whitelist - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) def test__login_required__no_whitelists__node_minimal(self): """""" @@ -2453,7 +2453,7 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) def test__login_required__no_whitelists__node_allow_anonymous(self): """""" @@ -2537,7 +2537,7 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) def test__login_required__no_whitelists__node_login_required(self): """""" @@ -2619,7 +2619,7 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.staff_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) def test__login_required__no_whitelists__node_allow_without_permissions(self): """""" @@ -2701,7 +2701,7 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.staff_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) def test__login_required__no_whitelists__node_one_permission_required(self): """""" @@ -2783,7 +2783,7 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) def test__login_required__no_whitelists__node_full_permissions_required(self): """""" @@ -2869,8 +2869,8 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes # region LoginRequired Mode, Login Whitelist - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__login_required__with_login_whitelist__node_minimal(self): """""" @@ -2950,8 +2950,8 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__login_required__with_login_whitelist__node_allow_anonymous(self): """""" @@ -3034,8 +3034,8 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__login_required__with_login_whitelist__node_login_required(self): """""" @@ -3115,8 +3115,8 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__login_required__with_login_whitelist__node_allow_without_permissions(self): """""" @@ -3196,8 +3196,8 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__login_required__with_login_whitelist__node_one_permission_required(self): """""" @@ -3279,8 +3279,8 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__login_required__with_login_whitelist__node_full_permissions_required(self): """""" @@ -3366,8 +3366,8 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes # region Strict Mode, No Whitelist - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) def test__strict__no_whitelists__node_minimal(self): """""" @@ -3447,8 +3447,8 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) def test__strict__no_whitelists__node_allow_anonymous(self): """""" @@ -3529,8 +3529,8 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) def test__strict__no_whitelists__node_login_required(self): """""" @@ -3612,8 +3612,8 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) def test__strict__no_whitelists__node_allow_without_permissions(self): """""" @@ -3695,8 +3695,8 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) def test__strict__no_whitelists__node_one_permission_required(self): """""" @@ -3778,8 +3778,8 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) def test__strict__no_whitelists__node_full_permissions_required(self): """""" @@ -3865,9 +3865,9 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes # region Strict Mode, Login Whitelist - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__strict__with_login_whitelist__node_minimal(self): """ Note: The LOGIN_EXEMPT_WHITELIST is only for login access. @@ -3955,9 +3955,9 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes # allowed = sidebar_menu.is_allowed_node(self.super_user, node) # self.assertTrue(allowed) # - # @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - # @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - # @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + # @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + # @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + # @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) # def test__strict__with_login_whitelist__node_allow_anonymous(self): # """""" # @@ -4039,9 +4039,9 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes # allowed = sidebar_menu.is_allowed_node(self.super_user, node) # self.assertTrue(allowed) # - # @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - # @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - # @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + # @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + # @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + # @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) # def test__strict__with_login_whitelist__node_login_required(self): # """""" # @@ -4123,9 +4123,9 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes # allowed = sidebar_menu.is_allowed_node(self.super_user, node) # self.assertTrue(allowed) # - # @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - # @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - # @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + # @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + # @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + # @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) # def test__strict__with_login_whitelist__node_allow_without_permissions(self): # """""" # @@ -4207,9 +4207,9 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes # allowed = sidebar_menu.is_allowed_node(self.super_user, node) # self.assertTrue(allowed) # - # @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - # @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - # @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + # @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + # @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + # @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) # def test__strict__with_login_whitelist__node_one_permission_required(self): # """""" # @@ -4291,9 +4291,9 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes # allowed = sidebar_menu.is_allowed_node(self.super_user, node) # self.assertTrue(allowed) # - # @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - # @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - # @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + # @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + # @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + # @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) # def test__strict__with_login_whitelist__node_full_permissions_required(self): # """""" # @@ -4379,9 +4379,9 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes # region Strict Mode, Permission Whitelist - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__strict__with_permission_whitelist__node_minimal(self): """""" @@ -4462,9 +4462,9 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__strict__with_permission_whitelist__node_allow_anonymous(self): """""" @@ -4546,9 +4546,9 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__strict__with_permission_whitelist__node_login_required(self): """""" @@ -4630,9 +4630,9 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__strict__with_permission_whitelist__node_allow_without_permissions(self): """""" @@ -4714,9 +4714,9 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__strict__with_permission_whitelist__node_one_permission_required(self): """""" @@ -4798,9 +4798,9 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__strict__with_permission_whitelist__node_full_permissions_required(self): """""" @@ -4886,10 +4886,10 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes # region Strict Mode, Both Whitelists - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__strict__with_both_whitelists__node_minimal(self): """""" @@ -4970,10 +4970,10 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__strict__with_both_whitelists__node_allow_anonymous(self): """""" @@ -5055,10 +5055,10 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__strict__with_both_whitelists__node_login_required(self): """""" @@ -5140,10 +5140,10 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__strict__with_both_whitelists__node_allow_without_permissions(self): """""" @@ -5225,10 +5225,10 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__strict__with_both_whitelists__node_one_permission_required(self): """""" @@ -5310,10 +5310,10 @@ class TemplateTagSidebarMenu_IsAllowedNodeTestCase(TemplateTagSidebarMenuBaseTes allowed = sidebar_menu.is_allowed_node(self.super_user, node) self.assertTrue(allowed) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) - @patch("adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) - @patch("adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_REQUIRED", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY", True) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.LOGIN_EXEMPT_WHITELIST", ["adminlte2_pdq:demo-css"]) + @patch("django_adminlte2_pdq.templatetags.sidebar_menu.STRICT_POLICY_WHITELIST", ["adminlte2_pdq:demo-css"]) def test__strict__with_both_whitelists__node_full_permissions_required(self): """""" diff --git a/tests/tests/test_views.py b/tests/tests/test_views.py index 8a61db9..c3bab20 100644 --- a/tests/tests/test_views.py +++ b/tests/tests/test_views.py @@ -11,7 +11,7 @@ from django.test import TestCase, RequestFactory from django.urls import reverse # Internal Imports. -from adminlte2_pdq import views +from django_adminlte2_pdq import views UserModel = get_user_model() # pylint: disable=invalid-name diff --git a/tests/urls.py b/tests/urls.py index 7e34cfa..82c07cc 100644 --- a/tests/urls.py +++ b/tests/urls.py @@ -19,7 +19,7 @@ from django.urls import include, path # Will use the custom 404 provided by the package. -handler404 = "adminlte2_pdq.views.view_404" +handler404 = "django_adminlte2_pdq.views.view_404" urlpatterns = [ @@ -29,5 +29,5 @@ urlpatterns = [ path("tests/", include("tests.test_urls")), # Adminlte2 views. path("accounts/", include("django.contrib.auth.urls")), - path("", include("adminlte2_pdq.urls")), + path("", include("django_adminlte2_pdq.urls")), ] diff --git a/tests/views.py b/tests/views.py index 2d1cbb0..a857626 100644 --- a/tests/views.py +++ b/tests/views.py @@ -7,14 +7,14 @@ from django.shortcuts import render from django.views.generic import TemplateView # Internal Imports. -from adminlte2_pdq.decorators import ( +from django_adminlte2_pdq.decorators import ( allow_anonymous_access, allow_without_permissions, login_required, permission_required, permission_required_one, ) -from adminlte2_pdq.mixins import ( +from django_adminlte2_pdq.mixins import ( AllowAnonymousAccessMixin, AllowWithoutPermissionsMixin, LoginRequiredMixin, -- GitLab