Answers for "test api register user"

0

test api register user

def test_api_register_user(self):
        response = self.client.post('/api/users', json={
            'username': 'bob',
            'email': '[email protected]',
            'password': 'bar'
        })
        assert response.status_code == 201

        # make sure the user is in the database
        user = User.query.filter_by(username='bob').first()
        assert user is not None
        assert user.email == '[email protected]'
Posted by: Guest on September-02-2021

Python Answers by Framework

Browse Popular Code Answers by Language