-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from factory import SubFactory | ||
from wagtail_factories import ImageChooserBlockFactory, PageFactory | ||
|
||
from .models import Collection | ||
|
||
|
||
class CollectionPageFactory(PageFactory): | ||
cover_image = SubFactory(ImageChooserBlockFactory) | ||
hero_image = SubFactory(ImageChooserBlockFactory) | ||
|
||
class Meta: | ||
model = Collection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
from django.test import TestCase | ||
|
||
from ov_collections.factories import CollectionPageFactory | ||
from ov_collections.models import Collection | ||
|
||
|
||
# Create your tests here. | ||
class ExhibitPageTests(TestCase): | ||
def test_exhibit_page_factory(self): | ||
""" | ||
ExhibitPageFactory creates ExhibitPage model instances | ||
""" | ||
self.assertIsInstance(CollectionPageFactory.create(), Collection) |