Last change
on this file since 1991 was
1991,
checked in by mylan, 14 years ago
|
#172: Tests: Force captcha dictionary patching only when it needed
|
-
Property svn:eol-style set to
native
|
File size:
1.2 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 |
---|
[1991] | 14 | from Products.CMFCore.utils import getToolByName |
---|
[1957] | 15 | |
---|
| 16 | from quintagroup.captcha.core.config import * |
---|
[1991] | 17 | from quintagroup.captcha.core import utils |
---|
[1984] | 18 | from quintagroup.captcha.core.utils import getWord, decrypt, parseKey, encrypt1 |
---|
[1957] | 19 | |
---|
[1991] | 20 | PATCH_WORDS = """heart |
---|
[1975] | 21 | glass |
---|
| 22 | blue |
---|
| 23 | false |
---|
| 24 | burn |
---|
| 25 | """ |
---|
[1991] | 26 | def testPatch(): |
---|
| 27 | # PATCH dictionary for captcha testing |
---|
| 28 | class TestData(object): |
---|
| 29 | words = PATCH_WORDS |
---|
[1975] | 30 | |
---|
[1991] | 31 | utils.basic_english = TestData() |
---|
| 32 | utils.CAPTCHAS_COUNT = len(utils.basic_english.words.split()) |
---|
| 33 | # END OF PATCH |
---|
[1975] | 34 | |
---|
[1957] | 35 | @onsetup |
---|
| 36 | def setup_product(): |
---|
| 37 | fiveconfigure.debug_mode = True |
---|
| 38 | import quintagroup.captcha.core |
---|
| 39 | zcml.load_config('configure.zcml', quintagroup.captcha.core) |
---|
| 40 | fiveconfigure.debug_mode = False |
---|
| 41 | ztc.installPackage('quintagroup.captcha.core') |
---|
| 42 | |
---|
| 43 | setup_product() |
---|
| 44 | ptc.setupPloneSite() |
---|
Note: See
TracBrowser
for help on using the repository browser.