How to test redirection in Django using pytest?
问题 I already know that one can implement a class that inherits from SimpleTestCase , and one can test redirection by: SimpleTestCase.assertRedirects(response, expected_url, status_code=302, target_status_code=200, host=None, msg_prefix='', fetch_redirect_response=True) However, I am wondering what is the way I can check for redirection using pytest: @pytest.mark.django_db def test_redirection_to_home_when_group_does_not_exist(create_social_user): """Some docstring defining what the test is