@@ -111,44 +111,47 @@ def test_catalog_delete_non_existing_draft_returns_404(authenticated_api_client)
111111
112112
113113@pytest .mark .integration
114- def test_catalog_publish_listing_draft (app , api_client ):
114+ def test_catalog_publish_listing_draft (app , authenticated_api_client ):
115115 # arrange
116+ current_user = authenticated_api_client .current_user
116117 listing_id = UUID (int = 1 )
117118 app .execute_command (
118119 CreateListingDraftCommand (
119120 listing_id = listing_id ,
120121 title = "Listing to be published" ,
121122 description = "..." ,
122123 ask_price = Money (10 ),
123- seller_id = UUID ( "00000000000000000000000000000002" ) ,
124+ seller_id = current_user . id ,
124125 )
125126 )
126127
127128 # act
128- response = api_client .post (f"/catalog/{ listing_id } /publish" )
129+ response = authenticated_api_client .post (f"/catalog/{ listing_id } /publish" )
129130
130131 # assert that the listing was published
131132 assert response .status_code == 200
132133
133134
134- def test_published_listing_appears_in_biddings (app , api_client ):
135+ def test_published_listing_appears_in_biddings (app , authenticated_api_client ):
135136 # arrange
136137 listing_id = UUID (int = 1 )
138+ current_user = authenticated_api_client .current_user
137139 app .execute_command (
138140 CreateListingDraftCommand (
139141 listing_id = listing_id ,
140142 title = "Listing to be published" ,
141143 description = "..." ,
142144 ask_price = Money (10 ),
143- seller_id = UUID ( "00000000000000000000000000000002" ) ,
145+ seller_id = current_user . id ,
144146 )
145147 )
146148 app .execute_command (
147149 PublishListingDraftCommand (
148150 listing_id = listing_id ,
151+ seller_id = current_user .id ,
149152 )
150153 )
151154
152155 url = f"/bidding/{ listing_id } "
153- response = api_client .get (url )
156+ response = authenticated_api_client .get (url )
154157 assert response .status_code == 200
0 commit comments