Skip to content.

Etria Lists

 

[quills-dev] [Collective-checkins] r49761 - Quills/trunk/tests

quills-dev at lists.etria.com quills-dev at lists.etria.com
Thu Sep 20 14:10:55 UTC 2007


Author: tomster
Date: Thu Sep 20 14:10:55 2007
New Revision: 49761

Modified:
   Quills/trunk/tests/base.py
Log:
less is better: before moving on i removed all the new code that wasn't actually making a noticeable difference. in the end i've simply added a `PloneTestCase.FunctionalTestCase` derived test class, added convenience code for the test browser and introduced the Mixin class.

Modified: Quills/trunk/tests/base.py
==============================================================================
--- Quills/trunk/tests/base.py	(original)
+++ Quills/trunk/tests/base.py	Thu Sep 20 14:10:55 2007
@@ -6,13 +6,6 @@
 
 from Testing import ZopeTestCase
 from Products.Five.testbrowser import Browser as BaseBrowser
-from transaction import commit
-from AccessControl.SecurityManagement import newSecurityManager
-
-from Products.Five import zcml
-
-# CMFCore imports
-from Products.CMFCore.utils import getToolByName
 
 # Let Zope know about Quills
 ZopeTestCase.installProduct('ATTrackback')
@@ -21,33 +14,10 @@
 # Import PloneTestCase - this registers more products with Zope as a side effect
 from Products.PloneTestCase import PloneTestCase
 from Products.PloneTestCase.PloneTestCase import setupPloneSite
-from Products.PloneTestCase.layer import PloneSite
-
-import quills.core
-import quills.app
 
 # Set up a Plone site, and apply the Quills extension profile
 setupPloneSite(products=['Quills', 'ATTrackback'])
 
-class QuillsSite(PloneSite):
-
-    @classmethod
-    def setUp(cls):
-        app = ZopeTestCase.app()
-        portal = app.plone
-        # login as admin (copied from `loginAsPortalOwner`)
-        uf = app.acl_users
-        user = uf.getUserById(PloneTestCase.portal_owner).__of__(uf)
-        newSecurityManager(None, user)
-        zcml.load_config('configure.zcml', quills.core)
-        zcml.load_config('configure.zcml', quills.app)
-        setup_tool = getToolByName(portal, 'portal_setup')
-        setup_tool.runAllImportStepsFromProfile('quills.core')        
-        setup_tool.runAllImportStepsFromProfile('quills.app')        
-
-        commit()
-        ZopeTestCase.close(app)
-
 
 class Browser(BaseBrowser):
 
@@ -81,14 +51,10 @@
     methods.
     """
 
-    layer = PloneSite
-
 
 class QuillsFunctionalTestCase(QuillsTestCaseMixin, PloneTestCase.FunctionalTestCase):
     """ a class for running functional tests."""
 
-    layer = QuillsSite
-
 
 class QuillsDocTestCase(QuillsTestCaseMixin, PloneTestCase.PloneTestCase):
     """Base class for integration tests for the 'Quills' product. This may
@@ -96,8 +62,6 @@
     methods.
     """
 
-    layer = PloneSite
-
 
 class QuillsContributorDocTestCase(QuillsDocTestCase):
     """As QuillsDocTestCase, but only gives the logged-in user the 'Contributor'

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Collective-checkins mailing list
Collective-checkins at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/collective-checkins



More information about the quills-dev mailing list