Skip to content

Ensured that each test module has its own router - #1345

Merged
n2ygk merged 1 commit into
django-json-api:mainfrom
sliverc:test_views_router
Oct 14, 2026
Merged

n2ygk merged 1 commit into
django-json-api:mainfrom
sliverc:test_views_router

Conversation

@sliverc

@sliverc sliverc commented Oct 14, 2026

Copy link
Copy Markdown
Member

Description of the Change

Currently other modules (e.g test_serializers.py) were able to resolve to views added to tests_views which is not desired.

Default views are added to tests/urls.py but if some tests need custom routers they need to define there own router.

Each tests then defines what urls it needs by setting pytest.mark.urls("tests.urls") marker.

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

@sliverc sliverc changed the title Ensured that each module has its own router Ensured that each test module has its own router Oct 14, 2026
@sliverc
sliverc requested a review from n2ygk October 14, 2026 06:58
Before other modules were able to resolve to views added to tests_views
which is not desired.

Default views are added to tests/urls.py but if some tests need custom
routers they need to define there own.
@n2ygk
n2ygk force-pushed the test_views_router branch from 5f6b96b to 25113e2 Compare October 14, 2026 12:14
@n2ygk
n2ygk merged commit 297be79 into django-json-api:main Oct 14, 2026
9 checks passed
@sliverc
sliverc deleted the test_views_router branch October 14, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants