MCPcopy
hub / github.com/django/django / test_custom_expiry_datetime

Method test_custom_expiry_datetime

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

Source from the content-addressed store, hash-verified

454 self.assertEqual(age, 10)
455
456 def test_custom_expiry_datetime(self):
457 modification = timezone.now()
458
459 self.session.set_expiry(modification + timedelta(seconds=10))
460
461 date = self.session.get_expiry_date(modification=modification)
462 self.assertEqual(date, modification + timedelta(seconds=10))
463
464 age = self.session.get_expiry_age(modification=modification)
465 self.assertEqual(age, 10)
466
467 async def test_custom_expiry_datetime_async(self):
468 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