Index: quintagroup.referencedatagridfield/branches/plone4/quintagroup/referencedatagridfield/tests.py
===================================================================
--- quintagroup.referencedatagridfield/branches/plone4/quintagroup/referencedatagridfield/tests.py	(revision 2333)
+++ 	(revision )
@@ -1,55 +1,0 @@
-import unittest
-
-#from zope.testing import doctestunit
-#from zope.component import testing
-from Testing import ZopeTestCase as ztc
-
-from Products.Five import fiveconfigure
-from Products.PloneTestCase import PloneTestCase as ptc
-from Products.PloneTestCase.layer import PloneSite
-ptc.setupPloneSite()
-
-import quintagroup.referencedatagridfield
-
-
-class TestCase(ptc.PloneTestCase):
-
-    class layer(PloneSite):
-
-        @classmethod
-        def setUp(cls):
-            fiveconfigure.debug_mode = True
-            ztc.installPackage(quintagroup.referencedatagridfield)
-            fiveconfigure.debug_mode = False
-
-        @classmethod
-        def tearDown(cls):
-            pass
-
-
-def test_suite():
-    return unittest.TestSuite([
-
-        # Unit tests
-        #doctestunit.DocFileSuite(
-        #    'README.txt', package='quintagroup.referencedatagridfield',
-        #    setUp=testing.setUp, tearDown=testing.tearDown),
-
-        #doctestunit.DocTestSuite(
-        #    module='quintagroup.referencedatagridfield.mymodule',
-        #    setUp=testing.setUp, tearDown=testing.tearDown),
-
-
-        # Integration tests that use PloneTestCase
-        #ztc.ZopeDocFileSuite(
-        #    'README.txt', package='quintagroup.referencedatagridfield',
-        #    test_class=TestCase),
-
-        #ztc.FunctionalDocFileSuite(
-        #    'browser.txt', package='quintagroup.referencedatagridfield',
-        #    test_class=TestCase),
-
-        ])
-
-if __name__ == '__main__':
-    unittest.main(defaultTest='test_suite')
Index: quintagroup.referencedatagridfield/branches/plone4/quintagroup/referencedatagridfield/tests/__init__.py
===================================================================
--- quintagroup.referencedatagridfield/branches/plone4/quintagroup/referencedatagridfield/tests/__init__.py	(revision 2334)
+++ quintagroup.referencedatagridfield/branches/plone4/quintagroup/referencedatagridfield/tests/__init__.py	(revision 2334)
@@ -0,0 +1,1 @@
+# 
Index: quintagroup.referencedatagridfield/branches/plone4/quintagroup/referencedatagridfield/tests/base.py
===================================================================
--- quintagroup.referencedatagridfield/branches/plone4/quintagroup/referencedatagridfield/tests/base.py	(revision 2334)
+++ quintagroup.referencedatagridfield/branches/plone4/quintagroup/referencedatagridfield/tests/base.py	(revision 2334)
@@ -0,0 +1,61 @@
+import unittest
+
+#from zope.testing import doctestunit
+#from zope.component import testing
+from Products.Five import zcml
+from Products.Five import fiveconfigure
+from Testing import ZopeTestCase as ztc
+
+from Products.Archetypes.tests.utils import makeContent
+
+from Products.Five import fiveconfigure
+from Products.PloneTestCase import PloneTestCase as ptc
+from Products.PloneTestCase.layer import PloneSite
+
+# install site
+ptc.setupPloneSite(extension_profiles=[
+        'quintagroup.referencedatagridfield:default',
+        'quintagroup.referencedatagridfield:examples'
+        ])
+
+import quintagroup.referencedatagridfield
+
+class MixIn(object):
+    """ Mixin for setting up the necessary bits for testing the
+        quintagroup.referencedatagridfield
+    """
+
+    class layer(PloneSite):
+
+        @classmethod
+        def setUp(cls):
+            fiveconfigure.debug_mode = True
+            zcml.load_config('configure.zcml',
+                             quintagroup.referencedatagridfield)
+            ztc.installPackage(quintagroup.referencedatagridfield)
+            fiveconfigure.debug_mode = False
+
+        @classmethod
+        def tearDown(cls):
+            pass
+
+    # def createDefaultStructure(self):
+    #     if 'layer1' not in self.portal.objectIds():
+    #         self.setRoles(['Manager'])
+    #         makeContent(self.portal, portal_type='Folder', id='layer1')
+    #         self.portal.layer1.setTitle('Layer1')
+    #         self.portal.layer1.reindexObject()
+    #         makeContent(self.portal.layer1, portal_type='Folder', id='layer2')
+    #         self.folder = self.portal.layer1.layer2
+    #         self.folder.setTitle('Layer2')
+    #         self.folder.reindexObject()
+    #         self.setRoles(['Member'])
+    #     return self.portal.layer1.layer2
+
+    # def removeDefaultStructure(self):
+    #     if 'layer1' in self.portal.objectIds():
+    #         self.portal._delObject('layer1')
+
+
+class TestCase(MixIn, ptc.PloneTestCase):
+    """ Base TestCase for quintagroup.referencedatagridfield """
