def test_create_token_for_user(self):
    'Test that a token is created for a user'
    payload = {'email': 'example@example.com', 'password': 'testpass'}
    create_user(**payload)
    res = self.client.post(TOKEN_URL, payload)
    self.assertTrue(res.status_code, status.HTTP_200_OK)
    self.assertIn('token', res.data)
Test that a token is created for a user
def test_create_token_for_user(self):
    
    payload = {'email': 'example@example.com', 'password': 'testpass'}
    create_user(**payload)
    res = self.client.post(TOKEN_URL, payload)
    self.assertTrue(res.status_code, status.HTTP_200_OK)
    self.assertIn('token', res.data)