diff --git a/MANIFEST.in b/MANIFEST.in index f1e4d3521b23e3e2612bf6cd52c3562d373691b8..0be42a8e41614d21ddca89fc478db2b229c4513e 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 751c776d5a3deea9f8f0ec1ed6437c7b07e6775f..5d30f50cae02ee4b9dab27cb46633e57fd7ea02d 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 5ba09518462cdd18054ddcc6adb41afdae048f30..689be19e5db8a23302466e141e65037c81e51fbf 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 06c9224710f82466190db0a8e6316f8a0a453b93..2ac4b8312a069905505efced9eca684803b94161 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 c7b7d154767a0e80ec723f13f0eae1e2584af152..9a9472d48132a084294da329be149e11f8a59b34 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 92ffbb4e7f5abaaafd29e5d6901af8d535c860d5..85e738b3c59d350b4eb3370a5a115737741f22a7 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 dff8a9ab91fa5c6cf5f37beb27beb4577bfd494c..e34955a74c074cb2ef15f79ee36e3aa2dbf668b9 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 fb5b2f8855d95676e78a2f7487ed66184ac29dca..c9c2036486aa576426b7f657ced27c1cd2b338e2 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 7ac8d3dd82f96bd806bdf48ef61843f10db136b4..0000000000000000000000000000000000000000 --- 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 9d41da83420836cd9f083c306578596006493c1e..0000000000000000000000000000000000000000 --- 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 3778109b25219469607b63706bd9b169944f93db..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..d5c95bb159df61d1614c58f57ee06e49842191a6 --- /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 0000000000000000000000000000000000000000..38615ead35b14139770f4361c45561e7153cd607 --- /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 0000000000000000000000000000000000000000..f2be5febff36b9b8b1bd412d1dab72b9cad7e797 --- /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 0000000000000000000000000000000000000000..61a7d7a6d0077787737c7cda06c5ca0f094c73ad --- /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 0000000000000000000000000000000000000000..0ab997bee6314b84f34281bafaa2327b054cdf1f --- /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 f638ab129ae7967001533f4dcd2a62f18d809fd4..c3164324d42d8b347b251c26b22776eed19fcd9d 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 5da4d83518ec2d37db1d3a9d8581a150c1bc3611..a71a9dac07e01f75eaa7c1fb1a0464c1bef9c0e0 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 d5f2c48c4648608448e7b9574e9f5d7c24eb7b19..a48e7d8b96507da876ba3b80165d04e9c8f069bd 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 62cef56d41b20f5d5c00409c1be36049e2374406..112ebee7e4782b35df816ca04c4eb00257aebe1f 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 e92e16f045d4560cb8c9e858c2dab71f4f312f6c..f8f77d840847aff0d4db91ceff8455d1ad4eb41f 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 77a6784257a4a565d1e790aea46ffaa6b078356f..1ba23f1f3568491633efcf4918225a8762dc431a 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 3d925d70dbaf650c736dca93da39d97045762294..de4a6411c97f58e5041c1f7602ef60bad590d606 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 1c30e204b1320c933734dd9898ed635d7b1cfe63..e16564fc1059c8b46610511e446333650e9bf843 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 36c7dec207fffad744f6d3af48051eb54d8d39b2..ae7d352972a75cfae4b5b0557d7caefddf4e5652 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 ed2fe2a8953b1bebf77008eb9bfbd048a46cf9c7..ae6b2d583df1b181ea1d6b91e17718191cdbfc41 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 bc12bcedbbf39c6d4bce365699bc120757e95bf7..15635ef0381b269b3b21e527c2da83ba3a0fc703 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 44538a51d5c4d293db3a6a16ccd66d45f47854a5..5b3d3c09473d85527fd7a07e7ea1457bb6138513 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 e8db4c6d7a331db6f0fadbc3eed6eb8ae60c1693..277c0589a8358b620087c2976ae666edc8a0724d 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 8629bea5d7f7c441553554fe615ad458bc016796..ea218cdcd5f8e960afd22532b4f60a1bc0224e7b 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 08c4abd6c6095e44a5824dbf4af373733b1f9e4a..ec5ee7385814fd65efaaa84b45e8e5681c91e9e4 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 5aea991497f93478483c3beb49653c9eccce0f5a..d0740eabc67b2eb052f5600a5c06819a0114ff2a 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 831f629155c0c08ee122986e34e6fd68dd52c1f5..169c18588baabc76c5551bfe17ffa3dfa01c5260 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 7340a446523218f180f7bd9df4890c0331e7f9b3..2dd5c67850419956b93acba6b16393e9c0913da2 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 50ad323b21a56f4575322cae9326f97f8df7b3f6..d14b1df44b5c5addeed46e52e233b25364811887 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 e270180d4357314cca9b75b616b1e6172e8731af..6a8c329e22272ce6a71968742f1a41c3de5ce8d4 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 d3c3761c948af016560519cdb879f4cfea75d2e3..2d11b97e9034282388f18f92ea2f689efa725be4 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 6303bb80e58d50f1e2ee09a99d8d56d4e2e482b3..d49845ff4f08bc128cb0e45ecbcc02abd2c10f5b 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 8a61db9664f32f6b47f02376226856dca25927e8..c3bab20f50a3060a98439e4ce6627cf760af0896 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 7e34cfa72ed31c1f7451c31c9e24abc84f9870e4..82c07cc0a776f6109372b6cb7a8179bf5e2141ef 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 2d1cbb082a8dd9669cb13185abd32d8a082dc01b..a857626bed3502f4900233e5fe08d1afd4bdd555 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,