diff --git a/cfgov/paying_for_college/migrations/0003_delete_repayingstudentdebtpage.py b/cfgov/paying_for_college/migrations/0003_delete_repayingstudentdebtpage.py new file mode 100644 index 00000000000..d2c6ea20cd1 --- /dev/null +++ b/cfgov/paying_for_college/migrations/0003_delete_repayingstudentdebtpage.py @@ -0,0 +1,21 @@ +# Generated by Django 3.2.20 on 2023-09-13 18:04 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('wagtailcore', '0078_referenceindex'), + ('wagtailforms', '0005_alter_formsubmission_form_data'), + ('wagtailinventory', '0003_pageblock_id_bigautofield'), + ('v1', '0008_deprecate_heading_related_posts_in_sidebar_breakout'), + ('wagtailredirects', '0008_add_verbose_name_plural'), + ('paying_for_college', '0002_deprecate_iug_sharing'), + ] + + operations = [ + migrations.DeleteModel( + name='RepayingStudentDebtPage', + ), + ] diff --git a/cfgov/paying_for_college/models/__init__.py b/cfgov/paying_for_college/models/__init__.py index 36dc69b5587..33a78a47aaf 100644 --- a/cfgov/paying_for_college/models/__init__.py +++ b/cfgov/paying_for_college/models/__init__.py @@ -23,7 +23,4 @@ get_region, make_divisible_by_6, ) -from paying_for_college.models.pages import ( - CollegeCostsPage, - RepayingStudentDebtPage, -) +from paying_for_college.models.pages import CollegeCostsPage diff --git a/cfgov/paying_for_college/models/pages.py b/cfgov/paying_for_college/models/pages.py index 6aed12d3010..76a526ef6a5 100644 --- a/cfgov/paying_for_college/models/pages.py +++ b/cfgov/paying_for_college/models/pages.py @@ -6,11 +6,12 @@ from v1.models import CFGOVPage -class PayingForCollegePage(CFGOVPage): - """A base class for our suite of PFC pages.""" +class CollegeCostsPage(CFGOVPage): + """Breaking down financial aid and loans for prospective students.""" header = StreamField( [ + ("hero", molecules.Hero()), ("text_introduction", molecules.TextIntroduction()), ("featured_content", organisms.FeaturedContent()), ], @@ -18,47 +19,14 @@ class PayingForCollegePage(CFGOVPage): use_json_field=True, ) - content_panels = CFGOVPage.content_panels + [ - FieldPanel("header"), - FieldPanel("content"), - ] - # Tab handler interface - edit_handler = TabbedInterface( - [ - ObjectList(content_panels, heading="General Content"), - ObjectList(CFGOVPage.sidefoot_panels, heading="Sidebar"), - ObjectList(CFGOVPage.settings_panels, heading="Configuration"), - ] - ) - - class Meta: - abstract = True - - def get_context(self, request, *args, **kwargs): - context = super().get_context(request) - context["return_user"] = "iped" in request.GET and request.GET["iped"] - return context - - -class PayingForCollegeContent(blocks.StreamBlock): - """A base content block for PFC pages.""" - - full_width_text = organisms.FullWidthText() - info_unit_group = organisms.InfoUnitGroup() - expandable_group = organisms.ExpandableGroup() - expandable = organisms.Expandable() - well = organisms.Well() - raw_html_block = blocks.RawHTMLBlock(label="Raw HTML block") - - -class CollegeCostsPage(PayingForCollegePage): - """Breaking down financial aid and loans for prospective students.""" - - header = StreamField( + content = StreamField( [ - ("hero", molecules.Hero()), - ("text_introduction", molecules.TextIntroduction()), - ("featured_content", organisms.FeaturedContent()), + ("full_width_text", organisms.FullWidthText()), + ("info_unit_group", organisms.InfoUnitGroup()), + ("expandable_group", organisms.ExpandableGroup()), + ("expandable", organisms.Expandable()), + ("well", organisms.Well()), + ("raw_html_block", blocks.RawHTMLBlock(label="Raw HTML block")), ], blank=True, use_json_field=True, @@ -69,28 +37,16 @@ class CollegeCostsPage(PayingForCollegePage): FieldPanel("content"), ] - # Tab handler interface edit_handler = TabbedInterface( [ ObjectList(content_panels, heading="General Content"), - # ObjectList(, heading='School and living situation'), ObjectList(CFGOVPage.settings_panels, heading="Configuration"), ] ) - content = StreamField( - PayingForCollegeContent, - blank=True, - use_json_field=True, - ) - template = "paying-for-college/college-costs.html" - -class RepayingStudentDebtPage(PayingForCollegePage): - """A page to serve static subpages in the paying-for-college suite.""" + template = "paying-for-college/college-costs.html" - content = StreamField( - PayingForCollegeContent, - blank=True, - use_json_field=True, - ) - template = "paying-for-college/repaying-student-debt.html" + def get_context(self, request, *args, **kwargs): + context = super().get_context(request) + context["return_user"] = "iped" in request.GET and request.GET["iped"] + return context diff --git a/cfgov/paying_for_college/tests/test_models.py b/cfgov/paying_for_college/tests/test_models.py index 74841c54b8c..5b129562174 100644 --- a/cfgov/paying_for_college/tests/test_models.py +++ b/cfgov/paying_for_college/tests/test_models.py @@ -11,19 +11,16 @@ from paying_for_college.apps import PayingForCollegeConfig from paying_for_college.models import ( Alias, - CollegeCostsPage, ConstantCap, ConstantRate, Contact, Nickname, Notification, Program, - RepayingStudentDebtPage, School, get_region, make_divisible_by_6, ) -from v1.models import HomePage class MakeDivisibleTest(TestCase): @@ -40,29 +37,6 @@ def test_make_divisible(self): self.assertTrue(make_divisible_by_6(test_value) == 48) -class PageModelsTest(TestCase): - def setUp(self): - def create_page(model, title, slug, parent): - new_page = model(live=False, title=title, slug=slug) - parent.add_child(instance=new_page) - new_page.save() - return new_page - - self.ROOT_PAGE = HomePage.objects.get(slug="cfgov") - self.debt_page = create_page( - RepayingStudentDebtPage, - "Repaying student debt", - "repaying-student-debt", - self.ROOT_PAGE, - ) - self.college_costs_page = create_page( - CollegeCostsPage, - "Understanding college costs", - "college-costs", - self.ROOT_PAGE, - ) - - class SchoolRegionTest(TestCase): def test_get_region(self): school = School(school_id="123456", state="NE")