Opened 3 years ago

Closed 3 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 3 years ago by digi604

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

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

comment:3 Changed 3 years ago by ojii

  • Component changed from Uncategorized to Core (URLs)
  • Has patch set
  • Patch needs improvement set
  • Type changed from Uncategorized to Bug

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 3 years ago by ojii

  • Cc ojiidotch@… added

comment:5 Changed 3 years ago by ojii

  • Resolution set to invalid
  • Status changed from new to closed

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

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