diff --git a/network-api/networkapi/donate/factory/__init__.py b/network-api/networkapi/donate/factory/__init__.py index 2d5a4a89e66..4cf574d84e9 100644 --- a/network-api/networkapi/donate/factory/__init__.py +++ b/network-api/networkapi/donate/factory/__init__.py @@ -1,10 +1,11 @@ -from . import help_page, landing_page +from . import help_page, landing_page, ways_to_give_page def generate(seed): # these are not, and should not be, alphabetically ordered. landing_page.generate(seed) help_page.generate(seed) + ways_to_give_page.generate(seed) __all__ = [ diff --git a/network-api/networkapi/donate/factory/ways_to_give_page.py b/network-api/networkapi/donate/factory/ways_to_give_page.py new file mode 100644 index 00000000000..ddf69ef3bff --- /dev/null +++ b/network-api/networkapi/donate/factory/ways_to_give_page.py @@ -0,0 +1,28 @@ +from factory import Faker +from wagtail_factories import PageFactory + +from networkapi.donate.models import DonateLandingPage +from networkapi.utility.faker import StreamfieldProvider +from networkapi.utility.faker.helpers import reseed +from networkapi.wagtailpages.models import OpportunityPage + +Faker.add_provider(StreamfieldProvider) + +streamfield_fields = ["paragraph", "linkbutton", "spacer", "quote"] + + +class DonateWaysToGivePageFactory(PageFactory): + class Meta: + # Using OpportunityPage AKA "Default Page" model + model = OpportunityPage + + title = Faker("sentence", nb_words=2) + body = Faker("streamfield", fields=streamfield_fields) + + +def generate(seed): + reseed(seed) + + print('Generating a Donate "Ways to give" page') + donate_home_page = DonateLandingPage.objects.get(title="Donate Now") + DonateWaysToGivePageFactory(parent=donate_home_page, title="Ways to Give", header="", slug="ways-to-give") diff --git a/tests/foundation-urls.js b/tests/foundation-urls.js index f46e8a3a19b..f207bd3f334 100644 --- a/tests/foundation-urls.js +++ b/tests/foundation-urls.js @@ -23,6 +23,7 @@ module.exports = { "/publication-page-with-chapter-pages/fixed-title-chapter-page/fixed-title-article-page", Donate: "/donate", "Donate Help": "/donate/help", + "Donate Ways To Give": "/donate/ways-to-give", PNI: "/privacynotincluded", "PNI (filtered for category)": "/privacynotincluded/categories/toys-games", "PNI general product page": "/privacynotincluded/general-percy-product",