'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('movedtemporarily', 200)

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

    >>> browser.open(self.portal_url)
    >>> browser.getLink('EasyForm').click()
    >>> browser.getControl('Title').value = 'testform'
    >>> browser.getControl('Force SSL connection').selected = True
    >>> browser.getControl('Save').click()
    >>> 'Item created' in browser.contents
    True
    >>> browser.url
    '.../testform/...'
    >>> 'Location' 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.) ::

    >>> self.anon_browser.open(self.portal_url + '/testform')
    >>> 'Location' in self.anon_browser.headers
    True
    >>> self.anon_browser.headers['Location']
    'https://nohost/plone/testform/view'

