Test indexes
============

Test getMails::

  >>> from iw.subscriber import catalog
  >>> catalog.getMails(portal, portal)
  []

Test canSubscribe::
 >>> catalog.canSubscribe(portal, portal)
 1

Test isSubscribed::

 >>> catalog.isSubscribed(portal, portal)
 0
 
Add an email::

  >>> from iw.subscriber.interfaces import ISubscriberStorage
  >>> data = ISubscriberStorage(portal).get()
  >>> data.add('gael@example.com')

And test getMails again::

  >>> from iw.subscriber import catalog
  >>> catalog.getMails(portal, portal)
  ['gael@example.com']

Disallow subscription to a content::

  >>> data = ISubscriberStorage(portal).get()
  >>> data.allow_subscription = False

And test canSubscribe again::

  >>> from iw.subscriber import catalog
  >>> catalog.canSubscribe(portal, portal)
  0

Test isSubscribed again::

  >>> catalog.isSubscribed(portal, portal)
  1

