Skip to content
Browse files

updated to latest factory boy

  • Loading branch information...
1 parent 3d5c57e commit 2523dbfd16e812af51ba41438aac68d13954940d @Tyrdall Tyrdall committed
Showing with 7 additions and 7 deletions.
  1. +6 −6 image_gallery/tests/factories.py
  2. +1 −1 requirements.txt
View
12 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)
View
2 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

0 comments on commit 2523dbf

Please sign in to comment.
Something went wrong with that request. Please try again.