revsys / django-test-plus

Useful additions to Django's default TestCase

Home Page:https://django-test-plus.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix passing arguments for self.get() and self.post()

mariodev opened this issue · comments

commented

When we pass url names into get/post methods, it seems we might get into trouble when using extra or follow as named arguments for url.

So when dealing with named urls, we should explicitly pass args and kwargs the same way as django's reverse function.

That's true, however it's super convenient when not using "extra" or "follow" as args for a URL. If a user needs to do that for whatever reason they can always drop back down to using the default client methods by using:

def some_test(self):
    self.client.post(self.reverse('name'....)