Ignore:
Timestamp:
6 Dec 2011, 16:06:16 (13 years ago)
Author:
uli
Message:

Add first test for getCaptcha.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/browser/tests/test_captcha.py

    r7285 r7286  
    1717##
    1818from zope.component import getAdapter, getUtility
     19from zope.component.hooks import setSite
    1920from zope.interface import verify
    2021from zope.publisher.browser import TestRequest
     
    120121        self.assertTrue(default_captcha is None)
    121122        return
     123
     124    def test_get_captcha_wo_site(self):
     125        # if there is no site set, we get the default captcha
     126        setSite(None)
     127        chooser = getUtility(ICaptchaChooser)
     128        result = chooser.getCaptcha()
     129        default = getUtility(ICaptcha)
     130        self.assertTrue(result is default)
     131        return
Note: See TracChangeset for help on using the changeset viewer.