Changeset 7298


Ignore:
Timestamp:
7 Dec 2011, 05:51:31 (13 years ago)
Author:
uli
Message:

Update tests.

File:
1 edited

Legend:

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

    r7295 r7298  
    8888        # null captchas accept any input request
    8989        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'}))
    9293        self.assertEqual(result1.is_valid, True)
    9394        self.assertEqual(result2.is_valid, True)
     
    112113        # is not empty or None
    113114        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)
    118125        self.assertEqual(result1.is_valid, False)
    119126        self.assertEqual(result2.is_valid, False)
Note: See TracChangeset for help on using the changeset viewer.