We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here's a barebones example - we may need to add factories for some more related models.
import factory import factory.fuzzy import wagtail_factories from wagtail import models as wagtail_models class BaseViewRestrictionFactory(factory.django.DjangoModelFactory): """ Factory for Wagtail's BaseViewRestriction model. """ restriction_type = factory.fuzzy.FuzzyChoice( wagtail_models.BaseViewRestriction.RESTRICTION_CHOICES ) password = factory.Faker("text", max_nb_chars=20) class Meta: model = wagtail_models.BaseViewRestriction abstract = True class PageViewRestrictionFactory(BaseViewRestrictionFactory): """ Factory for Wagtail's PageViewRestriction model. """ page = factory.SubFactory(wagtail_factories.PageFactory) class Meta: model = wagtail_models.PageViewRestriction class PasswordPageRestrictionFactory(PageViewRestrictionFactory): """ Factory for creating password restrictions for Wagtail pages. """ restriction_type = wagtail_models.BaseViewRestriction.PASSWORD
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Here's a barebones example - we may need to add factories for some more related models.
The text was updated successfully, but these errors were encountered: