[Zope-CVS] CVS: Products/Basket/tests - testBasket.py:1.21
Chris McDonough
chrism at plope.com
Wed Nov 9 19:31:12 EST 2005
Update of /cvs-repository/Products/Basket/tests
In directory cvs.zope.org:/tmp/cvs-serv19260/tests
Modified Files:
testBasket.py
Log Message:
Saner way of ensuring that pkg_resources exists (thanks to Fred):
- Rename our local copy of pkg_resources (it's 0.6a7)
- Try to import pkg_resources
- If it doesn't exist, import our renamed version and stuff it into sys.modules.
=== Products/Basket/tests/testBasket.py 1.20 => 1.21 ===
--- Products/Basket/tests/testBasket.py:1.20 Wed Nov 9 19:00:41 2005
+++ Products/Basket/tests/testBasket.py Wed Nov 9 19:31:12 2005
@@ -5,7 +5,7 @@
import Products
from Products.Basket.utils import EggProductContext
from Products.Basket import get_containing_package
-import pkg_resources # must come after some import of something in Basket
+import pkg_resources
from OFS.ObjectManager import ObjectManager
from OFS.SimpleItem import SimpleItem
from OFS.Folder import Folder
@@ -131,8 +131,7 @@
def test_pkg_resources_monkeypatch(self):
self.assertEqual(sys.modules['pkg_resources'],
- sys.modules['Basket.pkg_resources'],
- sys.modules['Products.Basket.pkg_resources'])
+ pkg_resources)
def test_require_success(self):
basket = self._makeOne()
More information about the Zope-CVS
mailing list