kotti_blog batching tests
=========================

Setup and Login
---------------

  >>> from kotti import testing
  >>> tools = testing.setUpFunctional(
  ...     **{'kotti.configurators': 'kotti_blog.kotti_configure',
  ...        'kotti_blog.blog_settings.pagesize': '2'})
  >>> browser = tools['Browser']()
  >>> ctrl = browser.getControl

  >>> browser.open(testing.BASE_URL + '/@@login')
  >>> "Log in" in browser.contents
  True
  >>> ctrl("Username or email").value = "admin"
  >>> ctrl("Password").value = "secret"
  >>> ctrl(name="submit").click()
  >>> "Welcome, Administrator" in browser.contents
  True

Add a blog and blogentries
--------------------------

  >>> browser.open(testing.BASE_URL + '/@@add_blog')
  >>> ctrl("Title").value = "New Blog"
  >>> ctrl("Body").value = "This is the new blog"
  >>> ctrl("save").click()

  >>> browser.open(testing.BASE_URL + '/new-blog/@@add_blogentry')
  >>> ctrl("Title").value = "First blog entry"
  >>> ctrl("Body").value = "And I like to say..."
  >>> ctrl("save").click()

  >>> browser.open(testing.BASE_URL + '/new-blog/')
  >>> 'pagination' in browser.contents
  False
  >>> 'Next' in browser.contents
  False

  >>> browser.open(testing.BASE_URL + '/new-blog/@@add_blogentry')
  >>> ctrl("Title").value = "Second blog entry"
  >>> ctrl("Body").value = "rumoring around a bit"
  >>> ctrl("save").click()
  >>> "Successfully added item" in browser.contents
  True

  >>> browser.open(testing.BASE_URL + '/new-blog/')
  >>> 'pagination' in browser.contents
  True
  >>> 'Next' in browser.contents
  False

  >>> browser.open(testing.BASE_URL + '/new-blog/@@add_blogentry')
  >>> ctrl("Title").value = "Second blog entry"
  >>> ctrl("Body").value = "rumoring around a bit"
  >>> ctrl("save").click()
  >>> "Successfully added item" in browser.contents
  True

  >>> browser.open(testing.BASE_URL + '/new-blog/')
  >>> 'pagination' in browser.contents
  True
  >>> 'Next' in browser.contents
  True

