Skip to content

Instantly share code, notes, and snippets.

@jamesvandyne
Created October 9, 2017 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesvandyne/2abad11a86a8c17d9f0670d7915316eb to your computer and use it in GitHub Desktop.
Save jamesvandyne/2abad11a86a8c17d9f0670d7915316eb to your computer and use it in GitHub Desktop.
@pytest.mark.django_db
def test_not_confirmed_redirects_anonymous_user_to_dashboard(anon_user):
view = Mock()
redirect = "/login/"
request = create_get_request(redirect, anon_user)
response = not_confirmed(view)(request)
assert not view.called
assert response.redirect == redirect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment