[Product-Developers] Problem creating first product

Gilles Lenfant gilles.lenfant at ingeniweb.com
Mon May 19 12:13:28 UTC 2008


Le 19 mai 08 à 05:54, ericx a écrit :

> I'm working thru Professional Plone development, and I have a  
> problem creating my first demo product.
>
> The demo as outlined in the book is simple enough. It is an initial  
> policy which does nothing but change the title and description. At  
> this stage, I have unit tests which indicate that I have passed both  
> these assumptions; but the product itself does not load; and I'm a  
> bit unsure where to look for errors.
>
> Starting the instance in the foreground produces no error; but the  
> new policy is unavailable in the list of installable products.  
> Testing the product does announce that it cannot be loaded (NOT  
> FOUND):
>
>  ** root at ethel ** /usr/local/www/hhsa ** Sun May 18 21:20:37
> # ./bin/instance test -s hhsa.policy
> Running tests at level 1
[...]

> Installing PloneLanguageTool ... done (0.051s)
> Test-module import failures:
>
> Module: hhsa.policy.tests
>
> AttributeError: 'module' object has no attribute 'test_suite'

Your myproduct/tests/test*.py modules should always look like this:

class MyTest1(xxxTestCase):
	...

class MyTest2(xxxTestCase):
	...

def test_suite()
	from unittest import TestSuite, makeSuite
	suite = TestSuite()
	suite.addTest(makeSuite(MyTest1))
	suite.addTest(makeSuite(MyTest2))
	return suite

HTH

-- 
Gilles Lenfant
INGENIWEB (TM) - SAS 50000 Euros - RC B 438 725 632
Bureaux de la Colline
1 rue Royal
92210 Saint Cloud
web : www.ingeniweb.com - « les Services Web Ingénieux »






More information about the Product-Developers mailing list