Skip to content

test: extend and consolidate tag inheritance tests into test_tag_inheritance.py#14771

Merged
mtesauro merged 4 commits intoDefectDojo:devfrom
valentijnscholten:tag-inheritance-tests
Apr 30, 2026
Merged

test: extend and consolidate tag inheritance tests into test_tag_inheritance.py#14771
mtesauro merged 4 commits intoDefectDojo:devfrom
valentijnscholten:tag-inheritance-tests

Conversation

@valentijnscholten
Copy link
Copy Markdown
Member

@valentijnscholten valentijnscholten commented Apr 28, 2026

Summary

  • Moves all tag-inheritance-related tests into a single unittests/test_tag_inheritance.py file, consolidating from test_tags.py, test_bulk_locations.py, and the now-deleted test_tags_signals.py
  • Adds three new pure-unit test classes (no DB) covering tags_signals.py internals: TestGetProducts, TestInheritProductTags, TestPropagateInheritanceEarlyExit

Move all tag-inheritance-related tests into a single file:
- InheritedTagsTests, InheritedTagsImportMixin, InheritedTagsImportTestAPI,
  InheritedTagsImportTestUI from test_tags.py
- TestTagInheritanceOnPersist from test_bulk_locations.py
- test_tags_signals.py (new unit tests, now absorbed)

Add new unit test classes covering tags_signals.py internals:
- TestGetProducts — isinstance routing for all model types
- TestInheritProductTags — per-product and system-wide flag gating
- TestPropagateInheritanceEarlyExit — early-exit short-circuit logic

Add class-level docstrings throughout for clarity.
Fix SSL redirect in InheritedTagsImportTestAPI/UI setUp.
@valentijnscholten valentijnscholten changed the title test: consolidate tag inheritance tests into test_tag_inheritance.py test: extend and consolidate tag inheritance tests into test_tag_inheritance.py Apr 28, 2026
@Maffooch Maffooch requested review from Jino-T and blakeaowens April 29, 2026 15:44
Copy link
Copy Markdown
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@mtesauro mtesauro merged commit 9f4d6c2 into DefectDojo:dev Apr 30, 2026
157 checks passed
Maffooch pushed a commit to devGregA/django-DefectDojo that referenced this pull request Apr 30, 2026
Pulls in 15 upstream commits including:

* dojo/sso/ consolidation (DefectDojo#14765) — SSO settings/urls/views/templates/
  remote-user moved into a self-contained package.
* dojo/notifications/ consolidation (DefectDojo#14767) — notification helper +
  templates moved into the package, with a new context_processors split.
* dojo/github/ consolidation (DefectDojo#14766) — github_issue_link package
  renamed and reshaped under dojo/github/{models,services,ui,...}.
* test_tag_inheritance.py extension (DefectDojo#14771).
* Bulk-delete findings extension hook (DefectDojo#14740).
* Planned-remediation-version column alignment fix (DefectDojo#14773).
* Dependency bumps (datatables.net, gitpython, python-gitlab, pyopenssl,
  vulners, ruff, postcss).

Conflict resolutions worth flagging:

* dojo/forms.py — kept dev's reshuffled imports (GITHUB_* models now
  re-exported via dojo.github.ui.forms; Global_Role moved to
  dojo.models). Dropped the duplicate Global_Role import; the legacy
  authorization rewrite still imports from
  dojo.authorization.models for the rest.
* dojo/settings/settings.dist.py — kept tailwind's UIPreferenceLoader
  chain and APP_DIRS=False, but added a shared
  _DOJO_EXTRA_TEMPLATE_DIRS list referenced by both TEMPLATES[0]["DIRS"]
  and the FilesystemLoader so that dojo/sso/settings.py:apply_sso_settings
  can append the SSO template dir at startup and have it resolved at
  render time.
* dojo/templates/dojo/login.html — Tailwind tree, kept the inline
  Tailwind-styled SSO buttons rather than dev's
  {% include "dojo/sso_login_buttons.html" %} (which is Bootstrap-classic
  flavored and mounted by the SSO consolidation against the classic tree
  only).
* unittests/test_remote_user.py — adopted dev's import path
  (dojo.sso.remote_user, dojo.models.Dojo_Group_Member).
* dojo/api_v2/permissions.py — added a backward-compat shim
  re-exporting from dojo.authorization.api_permissions because the
  legacy authorization consolidation deleted the old module but
  dojo/notifications/api/views.py (new from dev) still imports from the
  old path.

Verified: ruff clean on touched files; manage.py check passes;
unittests.test_authorized_users_ui + unittests.authorization +
unittests.test_user_ui_timestamps + unittests.test_rest_framework +
unittests.test_remote_user all green (1144 tests, 542 skipped).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants