[Checkins] SVN: megrok.five/trunk/src/megrok/five/test Functional test layer and a first functional test (doesn't work yet due to

Philipp von Weitershausen philikon at philikon.de
Thu Feb 15 11:33:55 EST 2007


Log message for revision 72603:
  Functional test layer and a first functional test (doesn't work yet due to
  a bug in the zope 2 instance recipe)
  

Changed:
  A   megrok.five/trunk/src/megrok/five/testing.py
  A   megrok.five/trunk/src/megrok/five/tests/test_zmiadd_functional.py

-=-
Added: megrok.five/trunk/src/megrok/five/testing.py
===================================================================
--- megrok.five/trunk/src/megrok/five/testing.py	2007-02-15 15:25:54 UTC (rev 72602)
+++ megrok.five/trunk/src/megrok/five/testing.py	2007-02-15 16:33:54 UTC (rev 72603)
@@ -0,0 +1,11 @@
+from Products.Five import zcml
+
+class FunctionalLayer:
+
+    @classmethod
+    def setUp(cls):
+        zcml.load_site()
+
+    @classmethod
+    def tearDown(cls):
+        raise NotImplementedError


Property changes on: megrok.five/trunk/src/megrok/five/testing.py
___________________________________________________________________
Name: svn:eol-style
   + native

Added: megrok.five/trunk/src/megrok/five/tests/test_zmiadd_functional.py
===================================================================
--- megrok.five/trunk/src/megrok/five/tests/test_zmiadd_functional.py	2007-02-15 15:25:54 UTC (rev 72602)
+++ megrok.five/trunk/src/megrok/five/tests/test_zmiadd_functional.py	2007-02-15 16:33:54 UTC (rev 72603)
@@ -0,0 +1,41 @@
+"""
+  >>> import grok
+  >>> grok.grok('megrok.five.tests.test_zmiadd_functional')
+
+First, let's create a manager user with which we can access the ZMI:
+
+  >>> uf = app.acl_users
+  >>> uf._doAddUser('mgr', 'mgrpw', ['Manager'], [])
+
+  >>> from Products.Five.testbrowser import Browser
+  >>> browser = Browser()
+  >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+  >>> browser.open('http://localhost/manage_main')
+
+  >>> add = browser.getControl(name=':action')
+
+  XXX The following test doesn't work due to a setup bug in the zope 2
+  instance buildout recipe...
+
+  #>>> 'megrok.five.tests.test_zmiadd_functional.TestApp' in add.displayOptions
+  #True
+
+"""
+import grok
+import megrok.five
+
+class TestApp(megrok.five.Model, grok.Application):
+    pass
+
+
+def test_suite():
+    import unittest
+    from megrok.five.testing import FunctionalLayer
+    from Testing.ZopeTestCase import FunctionalDocTestSuite
+
+    suite = FunctionalDocTestSuite()
+    suite.layer = FunctionalLayer
+    return unittest.TestSuite([suite])
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')


Property changes on: megrok.five/trunk/src/megrok/five/tests/test_zmiadd_functional.py
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the Checkins mailing list