diff --git a/image_gallery/tests/factories.py b/image_gallery/tests/factories.py index e4a6336..45062a2 100644 --- a/image_gallery/tests/factories.py +++ b/image_gallery/tests/factories.py @@ -1,28 +1,28 @@ """Factories for the models of the ``image_gallery`` app.""" -from factory import Factory, LazyAttribute, SubFactory, Sequence +from factory import DjangoModelFactory, LazyAttribute, SubFactory, Sequence from filer.models import Folder, Image from image_gallery.models import Gallery, GalleryCategory, GalleryPlugin -class FolderFactory(Factory): +class FolderFactory(DjangoModelFactory): FACTORY_FOR = Folder name = 'Test Folder' -class ImageFactory(Factory): +class ImageFactory(DjangoModelFactory): FACTORY_FOR = Image -class GalleryCategoryFactory(Factory): +class GalleryCategoryFactory(DjangoModelFactory): FACTORY_FOR = GalleryCategory name = Sequence(lambda i: 'name {}'.format(i)) slug = LazyAttribute(lambda a: a.name.replace(' ', '-')) -class GalleryFactory(Factory): +class GalleryFactory(DjangoModelFactory): FACTORY_FOR = Gallery title = 'Test Gallery' @@ -31,7 +31,7 @@ class GalleryFactory(Factory): is_published = True -class GalleryPluginFactory(Factory): +class GalleryPluginFactory(DjangoModelFactory): FACTORY_FOR = GalleryPlugin gallery = SubFactory(GalleryFactory) diff --git a/requirements.txt b/requirements.txt index 954e72c..94386cb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ South==0.7.6 # Packages needed for running the tests. Needed by contributors. # ============================================================== Fabric -factory_boy==1.2.0 +factory_boy==2.1.1 mock django-nose==1.1 coverage==3.5.3