コード例 #1
0
ファイル: test_captcha.py プロジェクト: wrestrtdr/weblate
 def test_tamper(self):
     hashed = hash_question('', 0) + '00'
     self.assertRaises(
         ValueError,
         unhash_question,
         hashed
     )
コード例 #2
0
ファイル: test_captcha.py プロジェクト: wrestrtdr/weblate
 def test_decode(self):
     question = '1 + 1'
     timestamp = 1000
     hashed = hash_question(question, timestamp)
     self.assertEqual(
         (question, timestamp),
         unhash_question(hashed)
     )
コード例 #3
0
ファイル: test_captcha.py プロジェクト: timesqueezer/weblate
 def test_tamper(self):
     hashed = hash_question('', 0) + '00'
     with self.assertRaises(ValueError):
         unhash_question(hashed)
コード例 #4
0
 def test_tamper(self):
     hashed = hash_question("", 0) + "00"
     self.assertRaises(ValueError, unhash_question, hashed)
コード例 #5
0
ファイル: test_captcha.py プロジェクト: nijel/weblate
 def test_tamper(self):
     hashed = hash_question('', 0) + '00'
     with self.assertRaises(ValueError):
         unhash_question(hashed)