'Force SSL' setting
-------------------

First let's get our test browser and make sure that it won't re-raise Redirect errors::

    >>> browser = self.browser
    >>> self.setStatusCode('Redirect', 200)

Set up a form with the 'force SSL' setting on::

    >>> browser.open(self.portal_url)
    >>> browser.getLink('Form Folder').click()
    >>> browser.getControl('Title').value = 'testform'
    
    >>> browser.getControl(name='forceSSL:boolean').value = '1'
    
    >>> browser.getControl('Save').click()
    >>> browser.url
    '.../testform/...'
    >>> 'Bobo-Exception-Type' in self.browser.headers
    False

Note that we didn't get forced to SSL immediately after creating the form.  (Which
would have raised a testbrowser error.)  That's because for people who have permission
to edit the form, 'force SSL' only takes place *on form submission*.

However, the form action should be set to an https URL so that the submission will still
be secure::

    >>> 'action="https://' in browser.contents
    True

Finally, let's use a new browser that isn't authenticated, and confirm that for someone
who doesn't have permission to edit the form, SSL will be forced on initial form load as
well (so the user sees a security icon in their browser.) ::

    >>> from Products.Five.testbrowser import Browser
    >>> browser = Browser()
    >>> browser.open(self.portal_url + '/testform')
    >>> browser.headers['Bobo-Exception-Type'] in ('Redirect', "<class 'zExceptions.Redirect'>")
    True
    
