forked from Princeton-CDH/cdh-web
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f773118
commit 6ca6414
Showing
10 changed files
with
52 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
cdhweb/pages/migrations/0056_remove_linkpage_extra_classes_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generated by Django 5.0.5 on 2024-07-07 23:49 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("cdhpages", "0055_alter_contentpage_attachments_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="linkpage", | ||
name="extra_classes", | ||
), | ||
migrations.RemoveField( | ||
model_name="linkpage", | ||
name="link_page", | ||
), | ||
migrations.RemoveField( | ||
model_name="linkpage", | ||
name="link_url", | ||
), | ||
migrations.RemoveField( | ||
model_name="linkpage", | ||
name="url_append", | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Generated by Django 5.0.5 on 2024-07-07 23:56 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('cdhpages', '0056_remove_linkpage_extra_classes_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.DeleteModel( | ||
name='PageIntro', | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,4 @@ | ||
import pytest | ||
from wagtail.models import Page | ||
|
||
from cdhweb.pages.context_processors import page_intro | ||
from cdhweb.pages.models import LinkPage, PageIntro | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_page_intro(rf): | ||
root = Page.objects.get(title="Root") | ||
link_page = LinkPage(title="Students", link_url="people/students") | ||
root.add_child(instance=link_page) | ||
intro = PageIntro.objects.create( | ||
page=link_page, paragraph="<p>We have great students</p>" | ||
) | ||
|
||
# should find a page intro for students | ||
assert page_intro(rf.get("/people/students/")) == {"page_intro": intro} | ||
# but not not for staff | ||
assert page_intro(rf.get("/people/staff/")) == {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters