[Zope3-checkins] CVS: Zope3/src/zope/app/sqlexpr/tests - test_sqlexpr.py:1.3

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Mar 9 07:39:12 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/sqlexpr/tests
In directory cvs.zope.org:/tmp/cvs-serv9939/src/zope/app/sqlexpr/tests

Modified Files:
	test_sqlexpr.py 
Log Message:


Adjusted code to use utility service to look up factories or use the new zapi
methods.




=== Zope3/src/zope/app/sqlexpr/tests/test_sqlexpr.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/sqlexpr/tests/test_sqlexpr.py:1.2	Wed Mar  3 21:06:15 2004
+++ Zope3/src/zope/app/sqlexpr/tests/test_sqlexpr.py	Tue Mar  9 07:39:11 2004
@@ -15,16 +15,15 @@
 
 $Id$
 """
-
 import unittest
 
 from zope.interface import implements
 from zope.component.interfaces import IFactory
 from zope.component.tests.placelesssetup import PlacelessSetup
-from zope.component.factory import provideFactory
 from zope.tales.tests.test_expressions import Data
 from zope.tales.engine import Engine
 
+from zope.app.tests import ztapi
 from zope.app.rdb.tests.stubs import ConnectionStub
 from zope.app.sqlexpr.sqlexpr import SQLExpr, NoConnectionSpecified
 
@@ -76,6 +75,9 @@
 class FactoryStub:
     implements(IFactory)
 
+    title = ''
+    description = ''
+
     def __call__(self, *args, **kw):
         return ConnectionStub
 
@@ -90,7 +92,8 @@
         self.context = Data(vars = {'rdb': 'rdb_conn',
                                     'dsn': 'dbi://test'})
         self.engine = Engine
-        provideFactory('rdb_conn', FactoryStub())
+        
+        ztapi.provideUtility(IFactory, FactoryStub(), 'rdb_conn')
 
     def test_exprUsingRDBAndDSN(self):
         expr = SQLExpr('name', 'SELECT num FROM hitchhike', self.engine)




More information about the Zope3-Checkins mailing list