Last change
on this file since 1984 was
1984,
checked in by mylan, 14 years ago
|
#172: added tests for static captchas
|
-
Property svn:eol-style set to
native
|
File size:
1.1 KB
|
Rev | Line | |
---|
[1957] | 1 | import unittest |
---|
| 2 | import os |
---|
| 3 | import sys |
---|
| 4 | import re |
---|
| 5 | |
---|
| 6 | from Products.Five import zcml |
---|
| 7 | from Products.Five import fiveconfigure |
---|
| 8 | |
---|
| 9 | from Testing import ZopeTestCase as ztc |
---|
| 10 | from Products.PloneTestCase.layer import onsetup |
---|
| 11 | from Products.PloneTestCase import PloneTestCase as ptc |
---|
| 12 | from Products.PloneTestCase.PloneTestCase import portal_owner |
---|
| 13 | from Products.PloneTestCase.PloneTestCase import default_password |
---|
| 14 | |
---|
| 15 | from quintagroup.captcha.core.config import * |
---|
[1984] | 16 | from quintagroup.captcha.core.utils import getWord, decrypt, parseKey, encrypt1 |
---|
[1957] | 17 | |
---|
[1975] | 18 | # PATCH dictionary for captcha testing |
---|
| 19 | from Products.CMFCore.utils import getToolByName |
---|
| 20 | class TestData(object): |
---|
| 21 | words = """heart |
---|
| 22 | glass |
---|
| 23 | blue |
---|
| 24 | false |
---|
| 25 | burn |
---|
| 26 | """ |
---|
| 27 | |
---|
| 28 | from quintagroup.captcha.core import utils |
---|
| 29 | utils.basic_english = TestData() |
---|
| 30 | utils.CAPTCHAS_COUNT = len(utils.basic_english.words.split()) |
---|
| 31 | # END OF PATCH |
---|
| 32 | |
---|
[1957] | 33 | @onsetup |
---|
| 34 | def setup_product(): |
---|
| 35 | fiveconfigure.debug_mode = True |
---|
| 36 | import quintagroup.captcha.core |
---|
| 37 | zcml.load_config('configure.zcml', quintagroup.captcha.core) |
---|
| 38 | fiveconfigure.debug_mode = False |
---|
| 39 | ztc.installPackage('quintagroup.captcha.core') |
---|
| 40 | |
---|
| 41 | setup_product() |
---|
| 42 | ptc.setupPloneSite() |
---|
Note: See
TracBrowser
for help on using the repository browser.