Skip to content

Commit

Permalink
Adds base collection test
Browse files Browse the repository at this point in the history
  • Loading branch information
mrharpo committed May 29, 2024
1 parent 9785b5c commit 73fd820
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ov_collections/factories.py
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
12 changes: 12 additions & 0 deletions ov_collections/tests.py
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)

0 comments on commit 73fd820

Please sign in to comment.