[Checkins] SVN: grokcore.view/new/src/grokcore/view/ftests/ Fix up ftests.

Philipp von Weitershausen philikon at philikon.de
Sat Aug 2 09:54:28 EDT 2008


Log message for revision 89227:
  Fix up ftests.
  

Changed:
  U   grokcore.view/new/src/grokcore/view/ftests/staticdir/simple_fixture/ellie.py
  D   grokcore.view/new/src/grokcore/view/ftests/url/application.py
  U   grokcore.view/new/src/grokcore/view/ftests/url/redirect.py
  U   grokcore.view/new/src/grokcore/view/ftests/url/url.py
  U   grokcore.view/new/src/grokcore/view/ftests/url/url_function.py
  U   grokcore.view/new/src/grokcore/view/ftests/view/argument.py
  U   grokcore.view/new/src/grokcore/view/ftests/view/index.py
  U   grokcore.view/new/src/grokcore/view/ftests/view/macros.py
  U   grokcore.view/new/src/grokcore/view/ftests/view/skindirective.py
  U   grokcore.view/new/src/grokcore/view/ftests/view/view.py

-=-
Modified: grokcore.view/new/src/grokcore/view/ftests/staticdir/simple_fixture/ellie.py
===================================================================
--- grokcore.view/new/src/grokcore/view/ftests/staticdir/simple_fixture/ellie.py	2008-08-02 13:54:12 UTC (rev 89226)
+++ grokcore.view/new/src/grokcore/view/ftests/staticdir/simple_fixture/ellie.py	2008-08-02 13:54:28 UTC (rev 89227)
@@ -1,6 +1,6 @@
-import grok
+import grokcore.view as grok
 
-class Mammoth(grok.Model):
+class Mammoth(grok.Context):
     pass
 
 class Index(grok.View):

Deleted: grokcore.view/new/src/grokcore/view/ftests/url/application.py
===================================================================
--- grokcore.view/new/src/grokcore/view/ftests/url/application.py	2008-08-02 13:54:12 UTC (rev 89226)
+++ grokcore.view/new/src/grokcore/view/ftests/url/application.py	2008-08-02 13:54:28 UTC (rev 89227)
@@ -1,66 +0,0 @@
-"""
-Views have an application_url() method to easily retrieve the url of the
-application::
-
-  >>> getRootFolder()['cave'] = cave = Cave()
-  >>> cave['caveman'] = CaveMan()
-
-Asking for the application_url on the cave returns the URL to the cave::
-
-  >>> from zope.testbrowser.testing import Browser
-  >>> browser = Browser()
-  >>> browser.handleErrors = False
-  >>> browser.open('http://localhost/cave')
-  >>> browser.contents
-  'http://localhost/cave'
-  
-Asking for the application_url on the caveman returns the URL to the cave as
-well::
-
-  >>> browser.open('http://localhost/cave/caveman')
-  >>> browser.contents
-  'http://localhost/cave'
-
-You can pass a name to specify a particular view or sub object to add
-to the URL::
-
-  >>> browser.open('http://localhost/cave/caveman/second')
-  >>> browser.contents
-  'http://localhost/cave/second'
-
-application_url also works with empty containers::
-
-  >>> from grok.ftests.url.application import Corridors
-  >>> cave['corridors'] = Corridors()
-  >>> browser.open('http://localhost/cave/corridors')
-  >>> browser.contents
-  'http://localhost/cave'
-  
-"""
-import zope.interface
-import grok
-
-class IMarker(zope.interface.Interface):
-    pass
-
-
-class Index(grok.View):
-    grok.context(IMarker)
-
-    def render(self):
-        return self.application_url()
-
-class Second(grok.View):
-    grok.context(IMarker)
-
-    def render(self):
-        return self.application_url('second')
-    
-class Cave(grok.Application, grok.Container):
-    grok.implements(IMarker)
-
-class CaveMan(grok.Model):
-    grok.implements(IMarker)
-
-class Corridors(grok.Container):
-    grok.implements(IMarker)

Modified: grokcore.view/new/src/grokcore/view/ftests/url/redirect.py
===================================================================
--- grokcore.view/new/src/grokcore/view/ftests/url/redirect.py	2008-08-02 13:54:12 UTC (rev 89226)
+++ grokcore.view/new/src/grokcore/view/ftests/url/redirect.py	2008-08-02 13:54:28 UTC (rev 89227)
@@ -14,9 +14,9 @@
   'http://localhost/manfred/another'
   
 """
-import grok
+import grokcore.view as grok
 
-class Mammoth(grok.Model):
+class Mammoth(grok.Context):
     pass
 
 class Index(grok.View):
@@ -26,5 +26,4 @@
 class Another(grok.View):
     def render(self):
         return "Another view"
-    
 

Modified: grokcore.view/new/src/grokcore/view/ftests/url/url.py
===================================================================
--- grokcore.view/new/src/grokcore/view/ftests/url/url.py	2008-08-02 13:54:12 UTC (rev 89226)
+++ grokcore.view/new/src/grokcore/view/ftests/url/url.py	2008-08-02 13:54:28 UTC (rev 89227)
@@ -1,4 +1,3 @@
-# -*- coding: UTF-8 -*-
 """
 Views have a method that can be used to construct URLs:
 
@@ -171,12 +170,13 @@
   '11'
 
 """
-import grok
+import grokcore.view as grok
+from zope.app.container.btree import BTreeContainer
 
-class Herd(grok.Container, grok.Model):
+class Herd(BTreeContainer, grok.Context):
     pass
 
-class Mammoth(grok.Model):
+class Mammoth(grok.Context):
     pass
 
 grok.context(Mammoth)

Modified: grokcore.view/new/src/grokcore/view/ftests/url/url_function.py
===================================================================
--- grokcore.view/new/src/grokcore/view/ftests/url/url_function.py	2008-08-02 13:54:12 UTC (rev 89226)
+++ grokcore.view/new/src/grokcore/view/ftests/url/url_function.py	2008-08-02 13:54:28 UTC (rev 89227)
@@ -1,9 +1,8 @@
-# -*- coding: UTF-8 -*-
 """
 There is a url function that can be imported from grok to determine the
 absolute URL of objects.
 
-  >>> from grok import url
+  >>> from grokcore.view import url
   
   >>> herd = Herd()
   >>> getRootFolder()['herd'] = herd
@@ -61,13 +60,14 @@
   >>> urllib.unquote(u).decode('utf-8') == expected
   True
 """
-import grok
-from grok import url
+import grokcore.view as grok
+from grokcore.view import url
+from zope.app.container.btree import BTreeContainer
 
-class Herd(grok.Container, grok.Model):
+class Herd(BTreeContainer, grok.Context):
     pass
 
-class Mammoth(grok.Model):
+class Mammoth(grok.Context):
     pass
 
 grok.context(Mammoth)

Modified: grokcore.view/new/src/grokcore/view/ftests/view/argument.py
===================================================================
--- grokcore.view/new/src/grokcore/view/ftests/view/argument.py	2008-08-02 13:54:12 UTC (rev 89226)
+++ grokcore.view/new/src/grokcore/view/ftests/view/argument.py	2008-08-02 13:54:28 UTC (rev 89227)
@@ -47,9 +47,9 @@
   TypeError: Missing argument to update(): message
 
 """
-import grok
+import grokcore.view as grok
 
-class Mammoth(grok.Model):
+class Mammoth(grok.Context):
     pass
 
 class RenderWithArguments(grok.View):

Modified: grokcore.view/new/src/grokcore/view/ftests/view/index.py
===================================================================
--- grokcore.view/new/src/grokcore/view/ftests/view/index.py	2008-08-02 13:54:12 UTC (rev 89226)
+++ grokcore.view/new/src/grokcore/view/ftests/view/index.py	2008-08-02 13:54:28 UTC (rev 89227)
@@ -17,9 +17,9 @@
   </html>
 
 """
-import grok
+import grokcore.view as grok
 
-class Mammoth(grok.Model):
+class Mammoth(grok.Context):
     teeth = u"Blue"
 
 class Index(grok.View):

Modified: grokcore.view/new/src/grokcore/view/ftests/view/macros.py
===================================================================
--- grokcore.view/new/src/grokcore/view/ftests/view/macros.py	2008-08-02 13:54:12 UTC (rev 89226)
+++ grokcore.view/new/src/grokcore/view/ftests/view/macros.py	2008-08-02 13:54:28 UTC (rev 89227)
@@ -45,9 +45,9 @@
   >>> warnings.warn = saved_warn
 
 """
-import grok
+import grokcore.view as grok
 
-class Mammoth(grok.Model):
+class Mammoth(grok.Context):
     pass
 
 class DancingHall(grok.View):

Modified: grokcore.view/new/src/grokcore/view/ftests/view/skindirective.py
===================================================================
--- grokcore.view/new/src/grokcore/view/ftests/view/skindirective.py	2008-08-02 13:54:12 UTC (rev 89226)
+++ grokcore.view/new/src/grokcore/view/ftests/view/skindirective.py	2008-08-02 13:54:28 UTC (rev 89227)
@@ -21,7 +21,7 @@
   Awesome
 
 """
-import grok
+import grokcore.view as grok
 from zope.app.basicskin import IBasicSkin
 from zope.app.rotterdam import rotterdam
 
@@ -33,7 +33,7 @@
 class MySkin(MySkinLayer):
     grok.skin('myskin')
 
-class Mammoth(grok.Model):
+class Mammoth(grok.Context):
     pass
 
 class CaveDrawings(grok.View):

Modified: grokcore.view/new/src/grokcore/view/ftests/view/view.py
===================================================================
--- grokcore.view/new/src/grokcore/view/ftests/view/view.py	2008-08-02 13:54:12 UTC (rev 89226)
+++ grokcore.view/new/src/grokcore/view/ftests/view/view.py	2008-08-02 13:54:28 UTC (rev 89227)
@@ -13,9 +13,9 @@
   </html>
 
 """
-import grok
+import grokcore.view as grok
 
-class Mammoth(grok.Model):
+class Mammoth(grok.Context):
     pass
 
 class Painting(grok.View):



More information about the Checkins mailing list