• Remember Mailing List

test error

from "Michael A Rowley, MD" on Oct 23, 2006 01:12 AM
Hello again.

Just looking for a little insite.  Have been trying to get my tests  
to run since moving to remember and membrane.  Has been rather an  
adventure.

again,  here is what I am running.

Python 2.4.3
Zope 2.9.5-final.
Plone 2.5.1
membrane svn checkout 21Oct2006
remember svn checkout 21Oct2006

here is the wierdness for today....

I am running the tests using the following command:

sudo /Applications/Plone-2.5.1/Instance/bin/zopectl test -vvvv -s  
Products.TORCH2

this only runs one test file in my tests directory, which does not  
inherit from the remember test class RememberTestBase,  then I get  
the error:

   Set up Products.remember.tests.base.RememberProfileLayer
Traceback (most recent call last):
   File "/Applications/Plone-2.5.1/bin/test.py", line 112, in ?
     sys.exit(testrunner.run(defaults))
   File "/Applications/Plone-2.5.1/lib/python/zope/testing/ 
testrunner.py", line 271, in run
     failed = not run_with_options(options)
   File "/Applications/Plone-2.5.1/lib/python/zope/testing/ 
testrunner.py", line 433, in run_with_options
     setup_layers, failures, errors)
   File "/Applications/Plone-2.5.1/lib/python/zope/testing/ 
testrunner.py", line 604, in run_layer
     setup_layer(layer, setup_layers)
   File "/Applications/Plone-2.5.1/lib/python/zope/testing/ 
testrunner.py", line 692, in setup_layer
     layer.setUp()
   File "/Applications/Plone-2.5.1/Instance/Products/remember/tests/ 
base.py", line 140, in setUp
     setup_tool.runAllImportSteps()
   File "/Applications/Plone-2.5.1/Instance/Products/GenericSetup/ 
tool.py", line 251, in runAllImportSteps
     message = self._doRunImportStep(step, context)
   File "/Applications/Plone-2.5.1/Instance/Products/GenericSetup/ 
tool.py", line 725, in _doRunImportStep
     return handler(context)
   File "/Applications/Plone-2.5.1/Instance/Products/CMFCore/ 
exportimport/content.py", line 44, in importSiteStructure
     IFilesystemImporter(context.getSite()).import_(context,  
'structure', True)
   File "/Applications/Plone-2.5.1/lib/python/zope/interface/ 
interface.py", line 682, in __call__
     raise TypeError("Could not adapt", obj, self)
TypeError: ('Could not adapt', <PloneSite at /plone>, <InterfaceClass  
Products.GenericSetup.interfaces.IFilesystemImporter>)
Exception exceptions.AttributeError: "'NoneType' object has no  
attribute 'has_key'" in <bound method SkinDataCleanup.__del__ of  
<Products.CMFCore.Skinnable.SkinDataCleanup instance at 0x532b670>>  
ignored


and it runs no further tests...

if I run each test individually with the following

sudo /Applications/Plone-2.5.1/Instance/bin/zopectl test -vvvv -s  
Products.TORCH2 -t '.*Install.*'

I don't get the above error, and the tests in that file run....

my test directory looks like this:

ls tests/
__init__.py             testCatalogs.py          
testInstall.py          testPatient.py          testSite.py
testAddress.py          testFacility.py          
testLogging.py          testProvider.py         torchTestCase.py

and the files look like this:
cat testInstall.py

import unittest, re
from Globals import PersistentMapping
from Testing import ZopeTestCase
from Products.PloneTestCase.PloneTestCase import PloneTestCase as ptc
from zope.app.tests import placelesssetup
from DateTime import DateTime
from Products.TORCH2.tests import torchTestCase as ttc
from Products.TORCH2.provider import Provider
from Products.TORCH2 import config
from Products.CMFCore.utils import getToolByName



class testInstall(ttc.torchTestCase):
     """
     Testing Project Install
     """
     def testPtDataContainerInstall(self):
         pd = getattr(self.portal, 'portal_patientdata', 'None')
         self.failUnless( pd.getId() == 'portal_patientdata' )

     def testMemberDataContainer(self):
         pd = getattr(self.portal, 'portal_memberdata')
         self.failUnless(pd.allowed_content_types ==  
config.INSTALL_MEMBER_TYPES)

def test_suite():
     suite = unittest.TestSuite()
     suite.addTest(unittest.makeSuite(testInstall
                                      )
                   )
     return suite

I have no clue why this is happening, but suspect it has something to  
do with my use of RememberTestBase
Here is my testCase subclass

cat torchTestCase.py
import transaction
from Products.CMFCore.utils  import getToolByName
from Products.PloneTestCase.ptc import *
from Products.TORCH2 import config
from Products.remember.tests.base import RememberTestBase
installProduct('BTreeFolder2')
installProduct('ZCatalog')
installProduct('membrane')
installProduct('remember')
install_products = (config.HARD_DEPS + config.SOFT_DEPS +  
(config.PROJECTNAME,))
for x in install_products:
     installProduct(x)


#setupPloneSite(products=['TORCH2'])

#####################
# default torch data
#####################

testPassword = 'secret'

testPatientData = { 'honorarium' : 'Mr.',
                     'lastname' : 'Washington',
                     'firstname' : 'George',
                     'middlename' : 'William',
                     'dob' : '1914/11/30',
                     'email' : 'test@...',
                     'password' : testPassword,
                     'confirm_password' : testPassword,
                     }

testPtUID = "GWW_18741130_"

testProviderData = { 'id' : "LAJivagoMD",
                      'lastname' : 'Jivago',
                      'middlename' : 'Anthony',
                      'firstname' : 'Lawrence',
                      'degree' : 'MD',
                      'email' : 'test@...',
                      'password' : testPassword,
                      'confirm_password' : testPassword,
                      }

testProviderID = "LAJivagoMD"

testStaffData = { 'lastname' : 'Fool',
                   'firstname' : 'Hard',
                   'middlename' : 'Working',
                   'dob' : '1914/11/30',
                   'email' : 'test@...',
                   'password' : testPassword,
                   'confirm_password' : testPassword,
                   }

class torchTestCase(RememberTestBase):
     """ base class for Torch integration testing """

     def afterSetUp(self):
         RememberTestBase.afterSetUp(self)
         # now add our Product I guess.
         qi = self.portal.portal_quickinstaller
         #qi.installProducts(['AlphaFlow',], stoponerror=1)
         qi.installProducts(['TORCH2',], stoponerror=1)
         self.mdata = getToolByName(self.portal, 'portal_memberdata')
         self.addProvider()
         self.addPatient()

     def addPatient(self):
         pd = getattr(self.portal, 'portal_patientdata')
         pd.invokeFactory(type_name='Patient', id=testPtUID)
         patient = pd._getOb(testPtUID)
         transaction.savepoint(optimistic=True)
         patient.processForm(values=testPatientData)
         self.testPtUID = patient.getId()
         self.patient = patient

     def addProvider(self):
         md = getToolByName(self.portal, 'portal_memberdata')
         md.invokeFactory(type_name='Provider', id=testProviderID)
         provider = md._getOb(testProviderID)
         transaction.savepoint(optimistic=True)
         provider.processForm(values=testProviderData)
         self.testProvId = provider.getId()
         self.provider = provider

     def addStaff(self):
         pass



If anyone can tell me what I am doing wrong, I would greatly  
appreciate it.

Michael

Return to date view: threaded or flat