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

Method test_user_registeration

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

Source from the content-addressed store, hash-verified

15
16 # Ensure user can register
17 def test_user_registeration(self):
18 with self.client:
19 response = self.client.post('register/', data=dict(
20 username='Michael', email='michael@realpython.com',
21 password='python', confirm='python'
22 ), follow_redirects=True)
23 self.assertIn(b'Welcome to Flask!', response.data)
24 self.assertTrue(current_user.name == "Michael")
25 self.assertTrue(current_user.is_active())
26 user = User.query.filter_by(email='michael@realpython.com').first()
27 self.assertTrue(str(user) == '<name - Michael>')
28
29 # Ensure errors are thrown during an incorrect user registration
30 def test_incorrect_user_registeration(self):

Callers

nothing calls this directly

Calls 1

is_activeMethod · 0.80

Tested by

no test coverage detected