[Zope3-checkins] CVS: Zope3/src/zope/app/presentation/tests - test_presentation.py:1.10 test_zpt.py:1.3

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Mar 29 10:09:01 EST 2004


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

Modified Files:
	test_presentation.py test_zpt.py 
Log Message:


Ripped out more usage code.




=== Zope3/src/zope/app/presentation/tests/test_presentation.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/presentation/tests/test_presentation.py:1.9	Mon Mar 22 19:23:11 2004
+++ Zope3/src/zope/app/presentation/tests/test_presentation.py	Mon Mar 29 10:08:58 2004
@@ -98,7 +98,6 @@
     implements(IZPTTemplate, IDependable, IRegistered)
 
     _dependents = ()
-    _usages = ()
 
     def addDependent(self, location):
         self._dependents = tuple(
@@ -115,21 +114,6 @@
     def dependents(self):
         return self._dependents
 
-    def addUsage(self, location):
-        self._usages = tuple(
-            [d for d in self._usages if d != location]
-            +
-            [location]
-            )
-
-    def removeUsage(self, location):
-        self._usages = tuple(
-            [d for d in self._usages if d != location]
-            )
-
-    def usages(self):
-        return self._usages
- 
 
 class A:
     def __init__(self, object, request):
@@ -452,8 +436,6 @@
         self.folder['test'] = registration
         dependents = zapi.getAdapter(self.__template, IDependable)
         self.assert_('test' in dependents.dependents())
-        usages = zapi.getAdapter(self.__template, IRegistered)
-        self.assert_('test' in usages.usages())
 
     def test_registerRemoveSubscriber_template(self):
         ztapi.provideAdapter(ILocation, IPhysicallyLocatable,
@@ -468,8 +450,6 @@
         uncontained(registration, self.folder, 'test')
         dependents = zapi.getAdapter(self.__template, IDependable)
         self.assert_('test' not in dependents.dependents())
-        usages = zapi.getAdapter(self.__template, IRegistered)
-        self.assert_('test' not in usages.usages())
         
     def test_addremoveNotify_attribute(self):
         ztapi.provideAdapter(ILocation, IPhysicallyLocatable,


=== Zope3/src/zope/app/presentation/tests/test_zpt.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/presentation/tests/test_zpt.py:1.2	Fri Mar 19 15:26:29 2004
+++ Zope3/src/zope/app/presentation/tests/test_zpt.py	Mon Mar 29 10:08:58 2004
@@ -46,35 +46,6 @@
         source = '<p>Test content</p>'
         template = factory('foo', 'text/html', source)
         self.assertEqual(template.source, source)
-
-    def test_usage(self):
-        template = ZPTTemplate()
-        template.source = ('usage: <span tal:replace="usage" />\n'
-                           'options: <span tal:replace="options" />'
-                           )
-        view = BrowserView(42, TestRequest())
-
-        self.assertEqual(template.render(view),
-                         'usage: \n'
-                         'options: {}\n'
-                         )
-
-        self.assertEqual(template.render(view, template_usage=u"spam"),
-                         "usage: spam\n"
-                         "options: {'template_usage': u'spam'}\n"
-                         )
-                           
-        template.usage = u'eggs'
-
-        self.assertEqual(template.render(view, template_usage=u"spam"),
-                         "usage: spam\n"
-                         "options: {'template_usage': u'spam'}\n"
-                         )
-
-        self.assertEqual(template.render(view),
-                         "usage: eggs\n"
-                         "options: {'template_usage': u'eggs'}\n"
-                         )
                            
 
 def test_suite():




More information about the Zope3-Checkins mailing list