revsys / django-test-plus

Useful additions to Django's default TestCase
https://django-test-plus.readthedocs.io
BSD 3-Clause "New" or "Revised" License
612 stars 62 forks source link

`assertGoodView` seems to expect an `url_name` as param but it never reverses it #202

Open nessita opened 1 year ago

nessita commented 1 year ago

The current signature of assertGoodView looks like this:

    def assertGoodView(self, url_name, *args, **kwargs):

but the implementation never reverses the url_name param so a valid url name results in a 404 instead of a 400.

nessita commented 1 year ago

OTOH, assertLoginRequired has this signature:

    def assertLoginRequired(self, url, *args, **kwargs):

but it forcibly calls reverse on URL, which fails if you pass the resolved url! :confused: