@@ -293,7 +293,7 @@ def test_file_response_with_inline_disposition(tmpdir, test_client_factory):
293
293
294
294
def test_set_cookie (test_client_factory , monkeypatch ):
295
295
# Mock time used as a reference for `Expires` by stdlib `SimpleCookie`.
296
- mocked_now = dt .datetime (2100 , 1 , 22 , 12 , 0 , 0 , tzinfo = dt .timezone .utc )
296
+ mocked_now = dt .datetime (2037 , 1 , 22 , 12 , 0 , 0 , tzinfo = dt .timezone .utc )
297
297
monkeypatch .setattr (time , "time" , lambda : mocked_now .timestamp ())
298
298
299
299
async def app (scope , receive , send ):
@@ -316,7 +316,7 @@ async def app(scope, receive, send):
316
316
assert response .text == "Hello, world!"
317
317
assert (
318
318
response .headers ["set-cookie" ]
319
- == "mycookie=myvalue; Domain=localhost; expires=Fri , 22 Jan 2100 12:00:10 GMT; "
319
+ == "mycookie=myvalue; Domain=localhost; expires=Thu , 22 Jan 2037 12:00:10 GMT; "
320
320
"HttpOnly; Max-Age=10; Path=/; SameSite=none; Secure"
321
321
)
322
322
@@ -325,15 +325,15 @@ async def app(scope, receive, send):
325
325
"expires" ,
326
326
[
327
327
pytest .param (
328
- dt .datetime (2100 , 1 , 22 , 12 , 0 , 10 , tzinfo = dt .timezone .utc ), id = "datetime"
328
+ dt .datetime (2037 , 1 , 22 , 12 , 0 , 10 , tzinfo = dt .timezone .utc ), id = "datetime"
329
329
),
330
- pytest .param ("Fri , 22 Jan 2100 12:00:10 GMT" , id = "str" ),
330
+ pytest .param ("Thu , 22 Jan 2037 12:00:10 GMT" , id = "str" ),
331
331
pytest .param (10 , id = "int" ),
332
332
],
333
333
)
334
334
def test_expires_on_set_cookie (test_client_factory , monkeypatch , expires ):
335
335
# Mock time used as a reference for `Expires` by stdlib `SimpleCookie`.
336
- mocked_now = dt .datetime (2100 , 1 , 22 , 12 , 0 , 0 , tzinfo = dt .timezone .utc )
336
+ mocked_now = dt .datetime (2037 , 1 , 22 , 12 , 0 , 0 , tzinfo = dt .timezone .utc )
337
337
monkeypatch .setattr (time , "time" , lambda : mocked_now .timestamp ())
338
338
339
339
async def app (scope , receive , send ):
@@ -344,7 +344,7 @@ async def app(scope, receive, send):
344
344
client = test_client_factory (app )
345
345
response = client .get ("/" )
346
346
cookie : SimpleCookie = SimpleCookie (response .headers .get ("set-cookie" ))
347
- assert cookie ["mycookie" ]["expires" ] == "Fri , 22 Jan 2100 12:00:10 GMT"
347
+ assert cookie ["mycookie" ]["expires" ] == "Thu , 22 Jan 2037 12:00:10 GMT"
348
348
349
349
350
350
def test_delete_cookie (test_client_factory ):
0 commit comments