def test_user_exists(self):
    payload = {'email': 'example@example.com', 'password': 'testpass', 'name': 'John Doe'}
    create_user(**payload)
    res = self.client.post(CREATE_USER_URL, payload)
    self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST)
def test_user_exists(self):
    payload = {'email': 'example@example.com', 'password': 'testpass', 'name': 'John Doe'}
    create_user(**payload)
    res = self.client.post(CREATE_USER_URL, payload)
    self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST)