Index: /quintagroup.ploneformgen.readonlystringfield/trunk/MANIFEST.in
===================================================================
--- /quintagroup.ploneformgen.readonlystringfield/trunk/MANIFEST.in	(revision 833)
+++ /quintagroup.ploneformgen.readonlystringfield/trunk/MANIFEST.in	(revision 834)
@@ -1,4 +1,6 @@
 global-include *.zcml
 global-include *.pot
+global-include *.po
 global-include *.xml
 global-include *.pt
+global-include *.txt
Index: /quintagroup.ploneformgen.readonlystringfield/trunk/quintagroup/ploneformgen/readonlystringfield/tests/base.py
===================================================================
--- /quintagroup.ploneformgen.readonlystringfield/trunk/quintagroup/ploneformgen/readonlystringfield/tests/base.py	(revision 833)
+++ /quintagroup.ploneformgen.readonlystringfield/trunk/quintagroup/ploneformgen/readonlystringfield/tests/base.py	(revision 834)
@@ -1,7 +1,8 @@
-from  Testing import ZopeTestCase as ztc
-from  Products.Five import zcml
-from  Products.Five import fiveconfigure
-from  Products.PloneTestCase import PloneTestCase as ptc
-from  Products.PloneTestCase.layer import onsetup
+from Testing import ZopeTestCase as ztc
+from Products.Five import zcml
+from Products.Five import fiveconfigure
+from Products.Five.testbrowser import Browser
+from Products.PloneTestCase import PloneTestCase as ptc
+from Products.PloneTestCase.layer import onsetup
 
 ztc.installProduct('PloneFormGen')
@@ -21,4 +22,9 @@
 ptc.setupPloneSite(products=['quintagroup.ploneformgen.readonlystringfield',])
 
+
 class ReadOnlyStringFieldTestCase(ptc.PloneTestCase):
     """Common test base class"""
+
+
+class ReadOnlyStringFieldFunctionalTestCase(ptc.FunctionalTestCase):
+    """Common functional test base class"""
Index: /quintagroup.ploneformgen.readonlystringfield/trunk/quintagroup/ploneformgen/readonlystringfield/tests/readonlystringfield.txt
===================================================================
--- /quintagroup.ploneformgen.readonlystringfield/trunk/quintagroup/ploneformgen/readonlystringfield/tests/readonlystringfield.txt	(revision 834)
+++ /quintagroup.ploneformgen.readonlystringfield/trunk/quintagroup/ploneformgen/readonlystringfield/tests/readonlystringfield.txt	(revision 834)
@@ -0,0 +1,61 @@
+Read only String Field
+----------------------
+
+Get our test browser::
+
+    >>> from Products.Five.testbrowser import Browser
+    >>> browser = Browser()
+    >>> portal_url = 'http://nohost/plone'
+    >>> self.app.acl_users.userFolderAddUser('root', 'secret', ['Manager'], [])
+    >>> browser.addHeader('Authorization', 'Basic root:secret')
+
+Add a new form folder and mark the subject input variable as a server side variable.
+(It needs a non-empty default value because it's set as required.) ::
+  
+    >>> self.setRoles(['Manager'])
+    >>> self.portal.invokeFactory('FormFolder', 'testform')
+    'testform'
+    >>> self.portal.testform.topic.setServerSide(True)
+    >>> self.portal.testform.topic.getServerSide()
+    True
+    >>> self.portal.testform.topic.setFgDefault('asdf')
+
+And confirm that the server-side field is absent from the rendered form::
+    
+    >>> browser.open(portal_url + '/testform')
+    >>> 'id="archetypes-fieldname-topic"' in  browser.contents
+    False
+
+By default when we submit the form the server-side field won't be included on the
+thank you page::
+
+    >>> self.portal.testform.mailer.setRecipient_email('mdummy@address.com')
+    >>> browser.getControl('Your E-Mail Address').value = 'test@example.com'
+    >>> browser.getControl('Comments').value = 'Now with double the rockage...'
+    >>> browser.getControl('Submit').click()
+    <sent mail from ...to ['mdummy@address.com']>
+    >>> 'Subject' in browser.contents
+    False
+
+Test for 'Subject' in the mail body::
+
+    >>> msgtext = self.portal.MailHost.msgtext[self.portal.MailHost.msgtext.index('\n\n'):]
+    >>> 'Subject' in self.portal.MailHost.msgtext.split('\n\n')[-1].decode('base64')
+    False
+
+Specifically list the field as one that should be included in the thank
+you page, and then it should show up in mail and thanks page::
+
+    >>> self.portal.testform['thank-you'].setShowAll(False)
+    >>> self.portal.testform['thank-you'].setShowFields(('topic',))
+    >>> self.portal.testform.mailer.setShowAll(False)
+    >>> self.portal.testform.mailer.setShowFields(('topic',))
+    >>> browser.goBack()
+    >>> browser.getControl('Your E-Mail Address').value = 'test@example.com'
+    >>> browser.getControl('Comments').value = 'Now with double the rockage...'
+    >>> browser.getControl('Submit').click()
+    <sent mail from ...to ['mdummy@address.com']>
+    >>> 'Subject' in self.portal.MailHost.msgtext.split('\n\n')[-1].decode('base64')
+    True
+    >>> 'Subject' in browser.contents
+    True
Index: /quintagroup.ploneformgen.readonlystringfield/trunk/quintagroup/ploneformgen/readonlystringfield/tests/test_docs.py
===================================================================
--- /quintagroup.ploneformgen.readonlystringfield/trunk/quintagroup/ploneformgen/readonlystringfield/tests/test_docs.py	(revision 834)
+++ /quintagroup.ploneformgen.readonlystringfield/trunk/quintagroup/ploneformgen/readonlystringfield/tests/test_docs.py	(revision 834)
@@ -0,0 +1,20 @@
+import unittest
+import doctest
+
+from Testing import ZopeTestCase as ztc
+
+from quintagroup.ploneformgen.readonlystringfield.tests.base import \
+    ReadOnlyStringFieldFunctionalTestCase
+
+def test_suite():
+    return unittest.TestSuite(
+        ztc.FunctionalDocFileSuite(
+            'readonlystringfield.txt',
+            package='quintagroup.ploneformgen.readonlystringfield.tests',
+            test_class=ReadOnlyStringFieldFunctionalTestCase,
+            optionflags= doctest.REPORT_ONLY_FIRST_FAILURE | \
+                doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS),
+    )
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')
Index: /quintagroup.ploneformgen.readonlystringfield/trunk/quintagroup/ploneformgen/readonlystringfield/tests/test_erase.py
===================================================================
--- /quintagroup.ploneformgen.readonlystringfield/trunk/quintagroup/ploneformgen/readonlystringfield/tests/test_erase.py	(revision 833)
+++ /quintagroup.ploneformgen.readonlystringfield/trunk/quintagroup/ploneformgen/readonlystringfield/tests/test_erase.py	(revision 834)
@@ -1,4 +1,7 @@
 import unittest
 import transaction
+from AccessControl.SecurityManagement import newSecurityManager, \
+    noSecurityManager
+from Testing import ZopeTestCase as ztc
 from Products.CMFCore.utils import getToolByName
 from  Products.PloneTestCase.layer import PloneSiteLayer
@@ -16,16 +19,24 @@
         @classmethod
         def setUp(cls):
-            pass
+            app = ztc.app()
+            portal = app.plone
+            
+            # elevate permissions
+            user = portal.getWrappedOwner()
+            newSecurityManager(None, user)
 
-        @classmethod
-        def tearDown(cls):
-            pass
+            tool = getToolByName(portal, 'portal_quickinstaller')
+            product_name = 'quintagroup.ploneformgen.readonlystringfield'
+            if tool.isProductInstalled(product_name):
+                tool.uninstallProducts([product_name,])
+            
+            # drop elevated perms
+            noSecurityManager()
+            
+            transaction.commit()
+            ztc.close(app)
     
     def afterSetUp(self):
         self.loginAsPortalOwner()
-        tool = getToolByName(self.portal, 'portal_quickinstaller')
-        product_name = 'quintagroup.ploneformgen.readonlystringfield'
-        if tool.isProductInstalled(product_name):
-            tool.uninstallProducts([product_name,])
     
     def test_factoryTool(self):
