Kotti HTTP Exception browser tests
==================================

Setup
-----
Create references to some useful tools:

   >>> from kotti import testing
   >>> tools = testing.setUpFunctional()
   >>> browser = tools['Browser']()
   >>> ctrl = browser.getControl

Tell the zope test browser to not raise errors for HTTP exceptions:

   >>> browser.raiseHttpErrors = False

Open the front page:

   >>> browser.open(testing.BASE_URL)


HTTP Not Found (404)
--------------------
A 404 Not Found view results in a nicely formatted, albeit plain page:

  >>> browser.open(testing.BASE_URL + '/non-existent')
  >>> 'Not Found' in browser.contents
  True

The not found view renders similarly for authenticated users.

After logging in:

  >>> browser.open(testing.BASE_URL + '/login')
  >>> ctrl("Username or email", index=0).value = "admin"
  >>> ctrl("Password").value = "secret"
  >>> ctrl(name="submit").click()

We should see the error message when visiting a URL that does not exist:

  >>> browser.open(testing.BASE_URL + '/non-existent')
  >>> 'Not Found' in browser.contents
  True


