def setUp(self): super(TestActivityPage, self).setUp() self.ROOT_PAGE = HomePage.objects.get(slug='cfgov') self.ROOT_PAGE.save_revision().publish() self.index_page = ActivityIndexPage(live=True, depth=1, title='Test Index', slug='test-index', path='test-index') publish_page(self.index_page)
def setUp(self): super(TestActivityIndexPageSearch, self).setUp() self.ROOT_PAGE = HomePage.objects.get(slug='cfgov') self.ROOT_PAGE.save_revision().publish() self.site = Site.objects.get(is_default_site=True) self.factory = RequestFactory() self.search_page = ActivityIndexPage(live=True, path='search', depth='1', title='Search for activities', slug='search') self.search_page.header = StreamValue( self.search_page.header.stream_block, [atomic.text_introduction], True) # noqa: E501 publish_page(child=self.search_page)
def setUp(self): self.site = Site.objects.get(is_default_site=True) self.root_page = self.site.root_page self.activity_index_page = ActivityIndexPage( title="Search for activities", slug="activities", ) self.wagtail_document = Document.objects.first() self.root_page.add_child(instance=self.activity_index_page) self.activity_page = ActivityPage( title="Storing my savings", slug="storing-my-savings", date="2020-02-21", live=True, summary="Students discuss safe places to store their money", big_idea="<p>You need a secure place to store your money.</p>", objectives=( "<ul><li>Understand different options to store your savings" "</li><li>Compare and contrast different options " "to store savings</li></ul>"), essential_questions=( "</p><ul><li>What are some benefits and risks?</li>" "<li>What options for storing your savings works for you now?" "</li></ul><p></p>"), what_students_will_do=( "<ul><li>Use the <strong>Evaluating savings scenarios</strong>" "worksheet to review real-world savingssituations.</li>" "<li>Recommend a savings tool(s) for each scenario.</li></ul>" ), activity_file=self.wagtail_document, activity_duration_id=1, ) self.activity_index_page.add_child(instance=self.activity_page) self.activity_page.building_block = [1, 2, 3] self.activity_page.school_subject = [1] self.activity_page.topic = [1] self.activity_page.grade_level = [1] self.activity_page.age_range = [1] self.activity_page.student_characteristics = [1] self.activity_page.teaching_strategy = [1] self.activity_page.blooms_taxonomy_level = [1] self.activity_page.jump_start_coalition = [1] self.activity_page.council_for_economic_education = [1] self.activity_page.activity_file = self.wagtail_document self.activity_page.save() self.doc = ActivityPageDocument() self.text_fields = [ 'big_idea', 'essential_questions', 'objectives', 'related_text', 'text', 'title', 'what_students_will_do', 'id', ] self.date_fields = ['date'] self.keyword_fields = [ 'activity_duration', 'activity_type', 'age_range', 'blooms_taxonomy_level', 'building_block', 'council_for_economic_education', 'grade_level', 'jump_start_coalition', 'school_subject', 'student_characteristics', 'teaching_strategy', 'topic', ] self.doc = ActivityPageDocument()