Skip to content

Instantly share code, notes, and snippets.

@Enforcer
Created April 14, 2019 15:01
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 Enforcer/e4a7cd5552908bcc6ece1b1351ebd0fe to your computer and use it in GitHub Desktop.
Save Enforcer/e4a7cd5552908bcc6ece1b1351ebd0fe to your computer and use it in GitHub Desktop.
def test_dashboard_requires_login(client):
user = User.objects.create(...) # 1
response = client.get('/dashboard') # 2
self.assertRedirects(response, '/accounts/login') # 3
assert user.last_access_attempt = ... # 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment