1 def test_api_register_user(self):
2 response = self.client.post('/api/users', json={
3 'username': 'bob',
4 'email': 'bob@example.com',
5 'password': 'bar'
6 })
7 assert response.status_code == 201
8
9 # make sure the user is in the database
10 user = User.query.filter_by(username='bob').first()
11 assert user is not None
12 assert user.email == 'bob@example.com'