@@ -35,7 +35,9 @@ def user2_data():
3535# Test creating user1
3636@pytest .fixture
3737def test_user1_creation (client , user1_data ):
38- response = client .post ("/api/v1/aro/user/" , json = user1_data , headers = {"Content-Type" : "application/json" })
38+ response = client .post (
39+ "/api/v1/aro/user/create_user" , json = user1_data , headers = {"Content-Type" : "application/json" }
40+ )
3941
4042 assert response .status_code == 200
4143 user = response .json ()["data" ]
@@ -51,7 +53,9 @@ def test_user1_creation(client, user1_data):
5153# Test creating user2
5254@pytest .fixture
5355def test_user2_creation (client , user2_data ):
54- response = client .post ("/api/v1/aro/user/" , json = user2_data , headers = {"Content-Type" : "application/json" })
56+ response = client .post (
57+ "/api/v1/aro/user/create_user" , json = user2_data , headers = {"Content-Type" : "application/json" }
58+ )
5559
5660 assert response .status_code == 200
5761 user = response .json ()["data" ]
@@ -75,7 +79,9 @@ def test_user1_update(client, test_user1_creation):
7579 "last_name" : "Smith" ,
7680 "phone_number" : "234567890" ,
7781 }
78- res = client .put (f"/api/v1/aro/user/{ user_id } " , json = update_data , headers = {"Content-Type" : "application/json" })
82+ res = client .put (
83+ f"/api/v1/aro/user/update_user/{ user_id } " , json = update_data , headers = {"Content-Type" : "application/json" }
84+ )
7985
8086 assert res .status_code == 200
8187 updated_user = res .json ()["data" ]
@@ -91,7 +97,7 @@ def test_user1_update(client, test_user1_creation):
9197# Test getting all users (after creating user1 and user2, and updating user1 to ensure creation and update work oncorrect user objects)
9298@pytest .fixture
9399def test_get_users (client , test_user1_update , test_user2_creation ):
94- res = client .get ("/api/v1/aro/user/" )
100+ res = client .get ("/api/v1/aro/user/get_all_users " )
95101
96102 assert res .status_code == 200
97103 all_users = res .json ()["data" ]
@@ -119,7 +125,7 @@ def test_get_users(client, test_user1_update, test_user2_creation):
119125# Test deleting user1 (after test_get_users to ensure both users exist)
120126def test_user1_deletion (client , test_user1_update , test_user2_creation , test_get_users ):
121127 user_id = test_user1_update ["id" ]
122- res = client .delete (f"/api/v1/aro/user/{ user_id } " , headers = {"Content-Type" : "application/json" })
128+ res = client .delete (f"/api/v1/aro/user/delete_user/ { user_id } " , headers = {"Content-Type" : "application/json" })
123129
124130 assert res .status_code == 200
125131 all_users = res .json ()["data" ]
0 commit comments