diff --git a/scipost_django/commentaries/factories.py b/scipost_django/commentaries/factories.py index f93c8c45fc3b93f308f66a44872e9f0c4035f22f..0f02de09aa1e581127923fdd0616a24ff6273ca3 100644 --- a/scipost_django/commentaries/factories.py +++ b/scipost_django/commentaries/factories.py @@ -28,7 +28,7 @@ class BaseCommentaryFactory(factory.django.DjangoModelFactory): vetted_by = factory.SubFactory("scipost.factories.ContributorFactory") type = LazyRandEnum(COMMENTARY_TYPES) acad_field = factory.SubFactory("ontology.factories.AcademicFieldFactory") - approaches = LazyRandEnum(SCIPOST_APPROACHES) + approaches = LazyRandEnum(SCIPOST_APPROACHES, repeat=2) open_for_commenting = True title = factory.Faker("sentence") diff --git a/scipost_django/commentaries/tests/test_factories.py b/scipost_django/commentaries/tests/test_factories.py new file mode 100644 index 0000000000000000000000000000000000000000..2d335a2825099c6d19c4ba45bca367e57fe9b9e3 --- /dev/null +++ b/scipost_django/commentaries/tests/test_factories.py @@ -0,0 +1,11 @@ +__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)" +__license__ = "AGPL v3" + +from django.test import TestCase +from commentaries.factories import CommentaryFactory + + +class TestCommentaryFactory(TestCase): + def test_can_create_commentaries(self): + commentary = CommentaryFactory() + self.assertIsNotNone(commentary)