Imports
-------

>>> import Persistence
>>> import zope.annotation.interfaces
>>> from zope.interface import implements


We need a testobject, where the SequenceGenerator stores his data:

>>> class Dummy(Persistence.Persistent):
...     implements(zope.annotation.interfaces.IAttributeAnnotatable)

>>> test_object = zope.annotation.interfaces.IAnnotations(Dummy())


Migration of the storage
------------------------

Due to a bug with Plone the key, where the storage is saved, has changed in
version 0.3. Old storages are auto-moved to the new key.

First we put a storage under the old key:

>>> test_object = zope.annotation.interfaces.IAnnotations(Dummy())
>>> from gocept.sequence.sequence import SequenceStorage
>>> test_object['gocept.sequence'] = SequenceStorage()
>>> test_object['gocept.sequence'].last_value = 3


Now get a new SequenceGenerator:

>>> from gocept.sequence.interfaces import ISequenceGenerator
>>> seq_gen_refactor = ISequenceGenerator(test_object)
>>> seq_gen_refactor.getNextValue()
4


The storage is now located under the new key:

>>> test_object.get('gocept.sequence')

>>> test_object.get('gocept_sequence_annotation')
<gocept.sequence.sequence.SequenceStorage object at 0x...>

