Changeset 18183 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 23 Sep 2025, 16:45:23 (14 months ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/browser
- Files:
-
- 3 edited
-
captcha.py (modified) (2 diffs)
-
pages.py (modified) (1 diff)
-
tests/test_captcha.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/captcha.py
r18173 r18183 120 120 ## 121 121 class StaticCaptcha(object): 122 """The StaticCaptcha always has the same solution: 'the-solution'.122 """The StaticCaptcha always has a random solution. 123 123 124 124 It is of no use for real world but for tests. In tests we cannot … … 153 153 """Display challenge and input field for solution as HTML. 154 154 """ 155 solution = random().randint(1000000000, 9999999999) 155 156 html = _( 156 157 u'<input type="hidden" name="challenge"' 157 u' value="the-solution" /><br />' 158 u'Type: %s<br />' 159 u'<input type="text" name="solution" value="the-solution"' 160 u' /><br />') 158 u' value="%s" />' 159 u'<input type="hidden" name="solution" value="%s"' 160 u' />' % (solution, solution)) 161 161 return html 162 162 -
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r18166 r18183 388 388 # No need to flash something. 389 389 return 390 else: 391 pass # goto 'if blocker' 390 392 else: 391 393 if not self.captcha_result.is_valid: -
main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_captcha.py
r18173 r18183 138 138 self.assertMatches( 139 139 '<input type="hidden" name="challenge"' 140 ' value="..." /> <br />Type: ...<br />'141 '<input type=" text" name="solution" value="the-solution" /><br/>',140 ' value="..." />' 141 '<input type="hidden" name="solution" value="..." />', 142 142 result) 143 143 return
Note: See TracChangeset for help on using the changeset viewer.
