@@ -180,7 +180,7 @@ async def test_apply_product_success(db, test_team, test_product):
180
180
db .commit ()
181
181
182
182
# Apply product to team
183
- await apply_product_for_team (db , test_team .stripe_customer_id , test_product .id )
183
+ await apply_product_for_team (db , test_team .stripe_customer_id , test_product .id , datetime . now ( UTC ) )
184
184
185
185
# Refresh team from database
186
186
db .refresh (test_team )
@@ -200,7 +200,7 @@ async def test_apply_product_team_not_found(db, test_product):
200
200
THEN: The operation completes without error
201
201
"""
202
202
# Try to apply product to non-existent team
203
- await apply_product_for_team (db , "cus_nonexistent" , test_product .id )
203
+ await apply_product_for_team (db , "cus_nonexistent" , test_product .id , datetime . now ( UTC ) )
204
204
# No assertions needed as function should complete without error
205
205
206
206
@pytest .mark .asyncio
@@ -217,7 +217,7 @@ async def test_apply_product_product_not_found(db, test_team):
217
217
db .commit ()
218
218
219
219
# Try to apply non-existent product
220
- await apply_product_for_team (db , test_team .stripe_customer_id , "prod_nonexistent" )
220
+ await apply_product_for_team (db , test_team .stripe_customer_id , "prod_nonexistent" , datetime . now ( UTC ) )
221
221
# No assertions needed as function should complete without error
222
222
223
223
@pytest .mark .asyncio
@@ -257,7 +257,7 @@ async def test_apply_product_multiple_products(db, test_team, test_product):
257
257
258
258
# Apply each product to the team
259
259
for product in products :
260
- await apply_product_for_team (db , test_team .stripe_customer_id , product .id )
260
+ await apply_product_for_team (db , test_team .stripe_customer_id , product .id , datetime . now ( UTC ) )
261
261
262
262
# Refresh team from database
263
263
db .refresh (test_team )
@@ -283,14 +283,14 @@ async def test_apply_product_already_active(db, test_team, test_product):
283
283
db .refresh (test_team ) # Refresh to ensure we have the latest data
284
284
285
285
# First apply the product
286
- await apply_product_for_team (db , test_team .stripe_customer_id , test_product .id )
286
+ await apply_product_for_team (db , test_team .stripe_customer_id , test_product .id , datetime . now ( UTC ) )
287
287
288
288
# Get the initial last payment date
289
289
db .refresh (test_team )
290
290
initial_last_payment = test_team .last_payment
291
291
292
292
# Apply the same product again
293
- await apply_product_for_team (db , test_team .stripe_customer_id , test_product .id )
293
+ await apply_product_for_team (db , test_team .stripe_customer_id , test_product .id , datetime . now ( UTC ) )
294
294
295
295
# Refresh team from database
296
296
db .refresh (test_team )
@@ -357,7 +357,7 @@ async def test_apply_product_extends_keys_and_sets_budget(mock_litellm, db, test
357
357
mock_instance .set_key_restrictions = AsyncMock ()
358
358
359
359
# Apply product to team
360
- await apply_product_for_team (db , test_team .stripe_customer_id , test_product .id )
360
+ await apply_product_for_team (db , test_team .stripe_customer_id , test_product .id , datetime . now ( UTC ) )
361
361
362
362
# Verify LiteLLM service was initialized with correct region settings
363
363
mock_litellm .assert_called_once_with (
@@ -400,7 +400,7 @@ async def test_remove_product_success(db, test_team, test_product):
400
400
db .commit ()
401
401
402
402
# First apply the product to ensure it exists
403
- await apply_product_for_team (db , test_team .stripe_customer_id , test_product .id )
403
+ await apply_product_for_team (db , test_team .stripe_customer_id , test_product .id , datetime . now ( UTC ) )
404
404
405
405
# Remove the product
406
406
await remove_product_from_team (db , test_team .stripe_customer_id , test_product .id )
@@ -491,8 +491,8 @@ async def test_remove_product_multiple_products(db, test_team, test_product):
491
491
db .commit ()
492
492
493
493
# Apply both products to the team
494
- await apply_product_for_team (db , test_team .stripe_customer_id , test_product .id )
495
- await apply_product_for_team (db , test_team .stripe_customer_id , second_product .id )
494
+ await apply_product_for_team (db , test_team .stripe_customer_id , test_product .id , datetime . now ( UTC ) )
495
+ await apply_product_for_team (db , test_team .stripe_customer_id , second_product .id , datetime . now ( UTC ) )
496
496
497
497
# Remove only the first product
498
498
await remove_product_from_team (db , test_team .stripe_customer_id , test_product .id )
0 commit comments