Right LOL So, here is the error I'm getting:

*Module: optilux.policy.tests

AttributeError: 'module' object has no attribute 'test_suite'


Module: optilux.policy.tests.test_setup

Traceback (most recent call last):
  File
"/home/hannes/optilux/src/optilux.policy/optilux/policy/tests/test_setup.py",
line 2, in ?
    from optilux.policy.tests.base import OptiluxPolicyTestCase
ImportError: No module named base
*

The __init__.py file looks as follows:

*from Products.Five import zcml
from Products.Five import fiveconfigure
from Testing import ZopeTestCase as ztc
from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase.layer import onsetup
@onsetup
def setup_optilux_policy():
    """Set up the additional products required for the Optilux site policy

    The @onsetup decorator causes the execution of this body to be deffered
    until the setup of the Plone site testing layer."""

    # Load the ZCML configuration for the optilux.policy package.

    fiveconfigure.debug_mode = True
    import optilux.policy
    zcml.load_config('configure.zcml', optilux.policy)
    fiveconfigure.debug_mode = False

    # We need to tell the testing framework that these products should be
    # available. This can't happen until after we have loaded the ZCML.

    ztc.installPackage('optilux.policy')

# The order here is important: We first call the (deferred) function which
# installs the products we need for the Optilux package. Then, we let
# PloneTestCase set up this product on installation.
setup_optilux_policy()
ptc.setupPloneSite(products=['optilux.policy'])
class OptiluxPolicyTestCase(ptc.PloneTestCase):
    """We use this base class for all the tests in this package. If
necessary,
    we can put common utility or setup code in here."""*

The test_setup.py looks as follows:

*import unittest
from optilux.policy.tests.base import OptiluxPolicyTestCase
class TestSetup(OptiluxPolicyTestCase):

    def test_portal_title(self):
        self.assertEquals("Optilux Cinemas",
self.portal.getProperty('title'))

    def test_portal_description(self):
        self.assertEquals("Welcome to Optilux Cinemas",
self.portal.getProperty('description'))

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

Thanks for the help guys :)

2008/10/27 Wichert Akkerman
<[EMAIL PROTECTED]<[EMAIL PROTECTED]>
>

> Previously hannesc wrote:
> > Aha! Could be a problem hey :)
> >
> > So I fixed the typo, and it gave me another error. I updated the original
>
> > post with the new error and updated file. :)
>
> This is email - you can't update emails after sending them :)
>
> Wichert.
>
> --
> Wichert Akkerman <[EMAIL 
> PROTECTED]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=1382788&i=0>>
>    It is simple to make things.
> http://www.wiggy.net/                   It is hard to make things simple.
>
> _______________________________________________
> Product-Developers mailing list
> [EMAIL 
> PROTECTED]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=1382788&i=1>
> http://lists.plone.org/mailman/listinfo/product-developers
>
>
> ------------------------------
>  View message @
> http://n2.nabble.com/Need-help-writing-tests-tp1381925p1382788.html
> To unsubscribe from Need help writing tests, click here< (link removed) >.
>
>
>


-- 
Regards,

Hannes Calitz
Developer
OpenNetworks
Tel +27 11 317 4900
Fax +27 0866 534 816
www.opennetworks.co.za
*****************************************************
ONCMS: Content Managed Websites
ONCRM: Customer Relationship Management
GMAIL: Commercial Google Mail Solutions

-- 
View this message in context: 
http://n2.nabble.com/Need-help-writing-tests-tp1381925p1385659.html
Sent from the Product Developers mailing list archive at Nabble.com.
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to