[Zope3-checkins] CVS: Zope3/src/zope/app/form/tests - test_utility.py:1.12

Jim Fulton jim@zope.com
Fri, 18 Apr 2003 18:12:58 -0400


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

Modified Files:
	test_utility.py 
Log Message:
In prepration for the upcoming interface changes, I added some
new functions for making interface assertions on instances.  

Rather than:

  class C:

     __class_implements__ = I1, I2

use:

  class C:

     classProvides(I1, I2)

rather than:

__implements__ = I1, I2

use:

moduleProvides(I1, I2)

rather than:

someinstance.__implements__ = I1, I2

use:

directlyProvides(I1, I2)

Note that interface assertions on persistent objects should be aboided
since the internal representation will change.

Continue to make assertions about the interfaces that class instances
implement the same way:

  class C:

     __implements__ = I1, I2


I also modified the core software to use the new spellings.



=== Zope3/src/zope/app/form/tests/test_utility.py 1.11 => 1.12 ===
--- Zope3/src/zope/app/form/tests/test_utility.py:1.11	Mon Apr 14 04:27:16 2003
+++ Zope3/src/zope/app/form/tests/test_utility.py	Fri Apr 18 18:12:26 2003
@@ -23,7 +23,7 @@
 from zope.publisher.browser import BrowserView
 from zope.publisher.browser import TestRequest
 from zope.publisher.interfaces.browser import IBrowserPresentation
-from zope.interface import Interface
+from zope.interface import Interface, directlyProvides
 from zope.schema import Text, accessors
 from zope.app.browser.form.widget import TextWidget
 from zope.component.view import provideView, setDefaultViewName
@@ -81,7 +81,7 @@
         w.custom = 1
         return w
 
-    title.__implements__ = IViewFactory
+    directlyProvides(title, IViewFactory)
 
 def kw(**kw):
     return kw