Changeset 7298
- Timestamp:
- 7 Dec 2011, 05:51:31 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/tests/test_captcha.py
r7295 r7298 88 88 # null captchas accept any input request 89 89 captcha = self.factory() 90 result1 = captcha.verify(CaptchaRequest('my-sol', 'my-challenge')) 91 result2 = captcha.verify(CaptchaRequest(None, None)) 90 result1 = captcha.verify(TestRequest()) 91 result2 = captcha.verify( 92 TestRequest(form={'solution': 'a', 'challenge': 'b'})) 92 93 self.assertEqual(result1.is_valid, True) 93 94 self.assertEqual(result2.is_valid, True) … … 112 113 # is not empty or None 113 114 captcha = self.factory() 114 result1 = captcha.verify(CaptchaRequest('my-sol', 'my-challenge')) 115 result2 = captcha.verify(CaptchaRequest(None, None)) 116 result3 = captcha.verify(CaptchaRequest('', '')) 117 result4 = captcha.verify(CaptchaRequest('my-sol', 'my-sol')) 115 request1 = TestRequest(form={'solution': 'my-sol', 116 'challenge': 'my-challenge'}) 117 request2 = TestRequest() 118 request3 = TestRequest(form={'solution': '', 'challenge': ''}) 119 request4 = TestRequest(form={'solution': 'my-sol', 120 'challenge': 'my-sol'}) 121 result1 = captcha.verify(request1) 122 result2 = captcha.verify(request2) 123 result3 = captcha.verify(request3) 124 result4 = captcha.verify(request4) 118 125 self.assertEqual(result1.is_valid, False) 119 126 self.assertEqual(result2.is_valid, False)
Note: See TracChangeset for help on using the changeset viewer.