2๐
โ
-
You can use
follow=True
in yourclient.post
which will emulate the browser following the redirect to the next page. See here in the docs. That will allow you to test the second pageโs content withassertContains
. -
You can use
assertRedirects
to test that the redirect happens properly. Check that out here in the docs.
๐คYPCrumble
Source:stackexchange.com