source: products/quintagroup.captcha.core/trunk/quintagroup/captcha/core/tests/base.py @ 1975

Last change on this file since 1975 was 1975, checked in by mylan, 14 years ago

#172: Fix breakage of right captcha submiting test

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1import unittest
2import os
3import sys
4import re
5
6from Products.Five import zcml
7from Products.Five import fiveconfigure
8
9from Testing import ZopeTestCase as ztc
10from Products.PloneTestCase.layer import onsetup
11from Products.PloneTestCase import PloneTestCase as ptc
12from Products.PloneTestCase.PloneTestCase import portal_owner
13from Products.PloneTestCase.PloneTestCase import default_password
14
15from quintagroup.captcha.core.config import *
16from quintagroup.captcha.core.utils import getWord, decrypt, parseKey
17
18# PATCH dictionary for captcha testing
19from Products.CMFCore.utils import getToolByName
20class TestData(object):
21    words = """heart
22glass
23blue
24false
25burn
26"""
27
28from quintagroup.captcha.core import utils
29utils.basic_english = TestData()
30utils.CAPTCHAS_COUNT = len(utils.basic_english.words.split())
31# END OF PATCH
32
33@onsetup
34def 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
41setup_product()
42ptc.setupPloneSite()
Note: See TracBrowser for help on using the repository browser.