import datetime
import factory

from django.template.defaultfilters import slugify

from . import models


class BaseFactory(factory.django.DjangoModelFactory):
    FACTORY_FOR = models.Base
    FACTORY_DJANGO_GET_OR_CREATE = ('romanized_name',)
    ABSTRACT_FACTORY = True


class AlbumFactory(BaseFactory):
    FACTORY_FOR = models.Album

    romanized_name = factory.Sequence(lambda i: 'album#%s' % i)
    released = datetime.date.today()
    slug = factory.LazyAttribute(lambda f: slugify(f.romanized_name))


class SingleFactory(BaseFactory):
    FACTORY_FOR = models.Single

    romanized_name = factory.Sequence(lambda i: 'single#%s' % i)
    released = datetime.date.today()
    slug = factory.LazyAttribute(lambda f: slugify(f.romanized_name))


class TrackFactory(BaseFactory):
    FACTORY_FOR = models.Track
    FACTORY_DJANGO_GET_OR_CREATE = ('romanized_name',)

    romanized_name = factory.Sequence(lambda i: 'track#%s' % i)

@@ -758,25 +758,206 @@
 ass 
-TrackFactory(Base
+EditionFactory(factory.django.DjangoModelFactory):%0A    FACTORY_FOR = models.Edition%0A%0A    romanized_name = factory.Sequence(lambda i: 'edition#%25s' %25 i)%0A%0A%0Aclass TrackFactory(factory.django.DjangoModel
 Fact

Add an EditionFactory.