コード例 #1
0
ファイル: test_models.py プロジェクト: pysoft-net/SmartElect
 def test_registration_unlocked(self):
     reg = RegistrationFactory()
     case = Case()
     self.assertFalse(case.registration_unlocked())
     case.registration = reg
     self.assertFalse(case.registration_unlocked())
     reg.unlocked_until = now() + datetime.timedelta(hours=1)
     self.assertTrue(case.registration_unlocked())
     case.relock_registration()
     self.assertFalse(case.registration_unlocked())
     case.registration = None
     self.assertFalse(case.registration_unlocked())