MCPcopy
hub / github.com/django/django / test_custom_expiry_seconds

Method test_custom_expiry_seconds

tests/sessions_tests/tests.py:400–409  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

398 )
399
400 def test_custom_expiry_seconds(self):
401 modification = timezone.now()
402
403 self.session.set_expiry(10)
404
405 date = self.session.get_expiry_date(modification=modification)
406 self.assertEqual(date, modification + timedelta(seconds=10))
407
408 age = self.session.get_expiry_age(modification=modification)
409 self.assertEqual(age, 10)
410
411 async def test_custom_expiry_seconds_async(self):
412 modification = timezone.now()

Callers

nothing calls this directly

Calls 4

set_expiryMethod · 0.80
get_expiry_dateMethod · 0.80
get_expiry_ageMethod · 0.80
nowMethod · 0.45

Tested by

no test coverage detected