@@ -53,9 +53,11 @@ def setUp(self) -> None:
53
53
54
54
def test_대여자가_정상적인_물품_대여신청을_했을때 (self ) -> None :
55
55
data = {
56
+ "borrower_id" : self .borrower .id ,
56
57
"product" : self .product .uuid ,
57
58
"rental_date" : timezone .now (),
58
59
"return_date" : timezone .now () + timedelta (days = 3 ),
60
+ "status" : "REQUEST" ,
59
61
}
60
62
response = self .client .post (self .url , data , headers = {"Authorization" : f"Bearer { self .token } " })
61
63
self .assertEqual (response .status_code , status .HTTP_201_CREATED )
@@ -73,9 +75,11 @@ def test_이미_대여중인_상품을_대여하려고_시도하는경우_테스
73
75
)
74
76
self .assertEqual (RentalHistory .objects .count (), 1 )
75
77
data = {
76
- "product" : history .product .uuid ,
78
+ "borrower_id" : int (self .borrower .id ),
79
+ "product" : str (history .product .uuid ),
77
80
"rental_date" : history .rental_date .isoformat (),
78
- "return_date" : history .return_date .isoformat (), # type: ignore
81
+ "return_date" : history .rental_date .isoformat (),
82
+ "status" : history .status ,
79
83
}
80
84
response = self .client .post (self .url , data , headers = {"Authorization" : f"Bearer { self .token } " })
81
85
self .assertEqual (response .status_code , status .HTTP_400_BAD_REQUEST )
@@ -188,7 +192,6 @@ def test_대여날짜_변경_테스트(self) -> None:
188
192
data = {"return_date" : timezone .now () + timedelta (days = 4 )}
189
193
190
194
response = self .client .patch (self .url , data = data , headers = {"Authorization" : f"Bearer { self .token } " })
191
- print (response .data )
192
195
self .assertEqual (response .status_code , status .HTTP_200_OK )
193
196
self .assertEqual (response .data .get ("return_date" ).split ("T" )[0 ], data ["return_date" ].date ().isoformat ())
194
197
0 commit comments