Opened 4 years ago

Closed 4 years ago

#18735 closed Bug (invalid)

unittest urlconf not picked up by reverse before first request

Reported by: digi604 Owned by: nobody
Component: Core (URLs) Version: 1.4
Severity: Normal Keywords:
Cc: ojiidotch@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

If your test class has a "urls" property defined it will not be picket up by reverse() before you make a request.

Change History (5)

comment:1 Changed 4 years ago by digi604

if the reverse testsuite is run on its own the tests fail:

./tests/runtests.py --settings=settings -v1 urlpatterns_reverse.URLPatternReverse

comment:3 Changed 4 years ago by Jonas Obrist

Component: UncategorizedCore (URLs)
Has patch: set
Patch needs improvement: set
Type: UncategorizedBug

Cannot reproduce with the instructions above, however I can reproduce it in the test suite of a 3rd party app, namely django-cms.

The original bug in django-cms can be found at https://github.com/divio/django-cms/pull/1360 and can be fixed by applying https://github.com/divio/django-cms/pull/1375 (which is the same as the patch proposed here).

So while the instructions to reproduce the issue seem to be flawed, the patch looks good to me.

comment:4 Changed 4 years ago by Jonas Obrist

Cc: ojiidotch@… added

comment:5 Changed 4 years ago by Jonas Obrist

Resolution: invalid
Status: newclosed

turned out to be an issue in the django-cms test suite.

Note: See TracTickets for help on using tickets.
Back to Top