This file demonstrates the use of picasa galleries.

    >>> from collective.plonetruegallery.tests.utils import getPhotoURLs
    >>> from collective.plonetruegallery.tests.utils import addSomePhotosToGallery
    >>> from Products.Five.testbrowser import Browser
	>>> from zope.testbrowser import interfaces
	>>> from zope.interface.verify import verifyObject
	>>> self.setRoles(("Manager",))
	>>> self.portal.portal_quickinstaller.installProduct("collective.plonetruegallery")
	''
	
    >>> browser = Browser()
    >>> browser.handleErrors = False
    >>> portal_url = self.portal.absolute_url()
    >>> from Products.PloneTestCase.setup import portal_owner, default_password
    
    >>> browser.open(portal_url + '/login_form?came_from=' + portal_url)
    >>> browser.getControl(name='__ac_name').value = portal_owner
    >>> browser.getControl(name='__ac_password').value = default_password
    >>> browser.getControl(name='submit').click()

    >>> browser.open(self.portal.absolute_url())
    >>> "Gallery" in browser.contents
    True
    >>> """<a href="http://nohost/plone/createObject?type_name=Gallery""" in browser.contents
    True
    
Let's create a new gallery
    >>> browser.getLink('Gallery').click()
    >>> browser.getControl(name='title').value = 'test'
    >>> browser.getControl(name='type').getControl(value='picasa').selected = True

Fill out the require picasa fields
    >>> browser.getControl(name='picasaUsername').value = 'vangheem@gmail.com'
    >>> browser.getControl(name='picasaAlbum').value = 'Dells of Eau Claire'
    >>> browser.getControl('Save').click()

    >>> "click here to view full sized image" in browser.contents
    True
    
    >>> "There are no images in this gallery" in browser.contents
    False
    
Let's create a new picasa gallery but forget to fill out some fields

    >>> browser.open(self.portal.absolute_url())
    >>> "Gallery" in browser.contents
    True
    >>> """<a href="http://nohost/plone/createObject?type_name=Gallery""" in browser.contents
    True
    
Let's create a new gallery
    >>> browser.getLink('Gallery').click()
    >>> browser.getControl(name='picasaAlbum').value = 'test'
    >>> browser.getControl(name='type').getControl(value='picasa').selected = True

Fill out the require picasa fields and create errors

Forgot to enter picasa username
    >>> browser.getControl(name='picasaAlbum').value = 'Dells of Eau Claire'
    >>> browser.getControl('Save').click()

    >>> "Picasa Error: Could not find album." in browser.contents
    True
    
Forgot to have the @gmail.com after picasa username
    >>> browser.getControl(name="picasaUsername").value = 'vangheem'
    >>> browser.getControl('Save').click()
    
    >>> "Picasa Error: You must specify a picasa username with the '@gmail.com'" in browser.contents
    True
    
Forget to specify album
    >>> browser.getControl(name="picasaUsername").value = 'vangheem@gmail.com'
    >>> browser.getControl(name='picasaAlbum').value = ''
    >>> browser.getControl('Save').click()
    
    >>> "There are no images in this gallery" in browser.contents
    True
    
Specify an incorrect album
    >>> browser.getLink("edit").click()
    >>> browser.getControl(name='picasaAlbum').value = 'Some Bogus Album'
    >>> browser.getControl('Save').click()
    
    >>> "Picasa Error: Could not find album." in browser.contents
    True
    
Now let's create the real album
    >>> browser.getControl(name='picasaAlbum').value = 'Dells of Eau Claire'
    >>> browser.getControl('Save').click()
    
    >>> "click here to view full sized image" in browser.contents
    True
    
    >>> "There are no images in this gallery" in browser.contents
    False