Skip to content

Commit

Permalink
updated to latest factory boy
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Lorenz committed Aug 2, 2013
1 parent 3d5c57e commit 2523dbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions 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'
Expand All @@ -31,7 +31,7 @@ class GalleryFactory(Factory):
is_published = True


class GalleryPluginFactory(Factory):
class GalleryPluginFactory(DjangoModelFactory):
FACTORY_FOR = GalleryPlugin

gallery = SubFactory(GalleryFactory)
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -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
Expand Down

0 comments on commit 2523dbf

Please sign in to comment.