44 CreateListingDraftCommand ,
55 PublishListingDraftCommand ,
66)
7- from seedwork .domain .value_objects import UUID , Money
7+ from seedwork .domain .value_objects import GenericUUID , Money
88
99
1010@pytest .mark .integration
@@ -17,13 +17,13 @@ def test_empty_catalog_list(api_client):
1717@pytest .mark .integration
1818def test_catalog_list_with_one_item (app , api_client ):
1919 # arrange
20- command_result = app .execute_command (
20+ app .execute_command (
2121 CreateListingDraftCommand (
22- listing_id = UUID (int = 1 ),
22+ listing_id = GenericUUID (int = 1 ),
2323 title = "Foo" ,
2424 description = "Bar" ,
2525 ask_price = Money (10 ),
26- seller_id = UUID ( "00000000000000000000000000000002" ),
26+ seller_id = GenericUUID ( int = 2 ),
2727 )
2828 )
2929
@@ -37,7 +37,7 @@ def test_catalog_list_with_one_item(app, api_client):
3737 assert response .json () == {
3838 "data" : [
3939 {
40- "id" : str (UUID (int = 1 )),
40+ "id" : str (GenericUUID (int = 1 )),
4141 "title" : "Foo" ,
4242 "description" : "Bar" ,
4343 "ask_price_amount" : 10.0 ,
@@ -52,20 +52,20 @@ def test_catalog_list_with_two_items(app, api_client):
5252 # arrange
5353 app .execute_command (
5454 CreateListingDraftCommand (
55- listing_id = UUID (int = 1 ),
55+ listing_id = GenericUUID (int = 1 ),
5656 title = "Foo #1" ,
5757 description = "Bar" ,
5858 ask_price = Money (10 ),
59- seller_id = UUID ( "00000000000000000000000000000002" ),
59+ seller_id = GenericUUID ( int = 2 ),
6060 )
6161 )
6262 app .execute_command (
6363 CreateListingDraftCommand (
64- listing_id = UUID (int = 2 ),
64+ listing_id = GenericUUID (int = 2 ),
6565 title = "Foo #2" ,
6666 description = "Bar" ,
6767 ask_price = Money (10 ),
68- seller_id = UUID ( "00000000000000000000000000000002" ),
68+ seller_id = GenericUUID ( int = 2 ),
6969 )
7070 )
7171
@@ -90,22 +90,22 @@ def test_catalog_delete_draft(app, authenticated_api_client):
9090 current_user = authenticated_api_client .current_user
9191 app .execute_command (
9292 CreateListingDraftCommand (
93- listing_id = UUID (int = 1 ),
93+ listing_id = GenericUUID (int = 1 ),
9494 title = "Listing to be deleted" ,
9595 description = "..." ,
9696 ask_price = Money (10 ),
9797 seller_id = current_user .id ,
9898 )
9999 )
100100
101- response = authenticated_api_client .delete (f"/catalog/{ str (UUID (int = 1 ))} " )
101+ response = authenticated_api_client .delete (f"/catalog/{ str (GenericUUID (int = 1 ))} " )
102102
103103 assert response .status_code == 204
104104
105105
106106@pytest .mark .integration
107107def test_catalog_delete_non_existing_draft_returns_404 (authenticated_api_client ):
108- listing_id = UUID ( "00000000000000000000000000000001" )
108+ listing_id = GenericUUID ( int = 1 )
109109 response = authenticated_api_client .delete (f"/catalog/{ listing_id } " )
110110 assert response .status_code == 404
111111
@@ -114,7 +114,7 @@ def test_catalog_delete_non_existing_draft_returns_404(authenticated_api_client)
114114def test_catalog_publish_listing_draft (app , authenticated_api_client ):
115115 # arrange
116116 current_user = authenticated_api_client .current_user
117- listing_id = UUID (int = 1 )
117+ listing_id = GenericUUID (int = 1 )
118118 app .execute_command (
119119 CreateListingDraftCommand (
120120 listing_id = listing_id ,
@@ -134,7 +134,7 @@ def test_catalog_publish_listing_draft(app, authenticated_api_client):
134134
135135def test_published_listing_appears_in_biddings (app , authenticated_api_client ):
136136 # arrange
137- listing_id = UUID (int = 1 )
137+ listing_id = GenericUUID (int = 1 )
138138 current_user = authenticated_api_client .current_user
139139 app .execute_command (
140140 CreateListingDraftCommand (
0 commit comments