MCPcopy Index your code
hub / github.com/realpython/discover-flask / test_correct_login

Method test_correct_login

tests/test_users.py:63–72  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

61
62 # Ensure login behaves correctly with correct credentials
63 def test_correct_login(self):
64 with self.client:
65 response = self.client.post(
66 '/login',
67 data=dict(username="admin", password="admin"),
68 follow_redirects=True
69 )
70 self.assertIn(b'You were logged in', response.data)
71 self.assertTrue(current_user.name == "admin")
72 self.assertTrue(current_user.is_active())
73
74 # Ensure login behaves correctly with incorrect credentials
75 def test_incorrect_login(self):

Callers

nothing calls this directly

Calls 1

is_activeMethod · 0.80

Tested by

no test coverage detected