Example #1
0
    def test_html_formatting(self):
        make_job_listing_page(
            title='Manager',
            grades=['1', '2', '3'],
            close_date=date(2099, 8, 5),
            regions=['NY', 'DC']
        )
        make_job_listing_page(
            title='Assistant',
            grades=['12'],
            close_date=date(2099, 4, 21),
            regions=['Silicon Valley']
        )

        block = JobListingList()
        html = block.render(
            block.to_python({}),
            context={'request': self.request}
        )

        self.assertHtmlRegexpMatches(html, (
            '<li class="list_item">'
            '<a class="list_link" href=".*">Assistant</a>'
            '<p class="date">CLOSING<span class="datetime">'
            '.*APR 21, 2099.*</span></p>'
            '</li>'
            '<li class="list_item">'
            '<a class="list_link" href=".*">Manager</a>'
            '<p class="date">CLOSING<span class="datetime">.'
            '*AUG 05, 2099.*</span></p>'
            '</li>'
        ))
Example #2
0
    def test_html_formatting(self):
        make_job_listing_page(
            title='Manager',
            grades=['1', '2', '3'],
            close_date=date(2099, 8, 5),
            regions=['NY', 'DC']
        )
        make_job_listing_page(
            title='Assistant',
            grades=['12'],
            close_date=date(2099, 4, 21),
            regions=['Silicon Valley']
        )

        block = JobListingList()
        html = block.render(
            block.to_python({}),
            context={'request': self.request}
        )

        self.assertHtmlRegexpMatches(html, (
            '<li class="list_item">'
            '<a class="list_link" href=".*">Assistant</a>'
            '<p class="date">CLOSING<span class="datetime">'
            '.*APR 21, 2099.*</span></p>'
            '</li>'
            '<li class="list_item">'
            '<a class="list_link" href=".*">Manager</a>'
            '<p class="date">CLOSING<span class="datetime">.'
            '*AUG 05, 2099.*</span></p>'
            '</li>'
        ))
Example #3
0
    def test_html_formatting(self):
        make_job_listing_page(title='Manager',
                              grades=['1', '2', '3'],
                              close_date=date(2099, 8, 5))
        make_job_listing_page(title='Assistant',
                              grades=['12'],
                              close_date=date(2099, 4, 21))

        block = JobListingList()
        html = block.render(block.to_python({}),
                            context={'request': self.request})

        self.assertHtmlRegexpMatches(
            html, ('<li class="m-list_item">'
                   '<a class="m-list_link" href=".*">Assistant' +
                   '<span class="m-list_link-subtext">Closing' +
                   '<span class="datetime">.*Apr. 21, 2099.*</span>'
                   '</span></a>'
                   '</li>'
                   '<li class="m-list_item">'
                   '<a class="m-list_link" href=".*">Manager' +
                   '<span class="m-list_link-subtext">Closing' +
                   '<span class="datetime">.*Aug. 5, 2099.*</span>'
                   '</span></a>'
                   '</li>'))
Example #4
0
    def test_html_formatting(self):
        make_job_listing_page(
            title='Manager',
            grades=['1', '2', '3'],
            close_date=date(2099, 8, 5)
        )
        make_job_listing_page(
            title='Assistant',
            grades=['12'],
            close_date=date(2099, 4, 21)
        )

        block = JobListingList()
        html = block.render(
            block.to_python({}),
            context={'request': self.request}
        )

        self.assertHtmlRegexpMatches(html, (
            '<li class="m-list_item">'
            '<a class="m-list_link" href=".*">Assistant' +
            '<span class="m-list_link-subtext">Closing' +
            '<span class="datetime">.*Apr. 21, 2099.*</span>'
            '</span></a>'
            '</li>'
            '<li class="m-list_item">'
            '<a class="m-list_link" href=".*">Manager' +
            '<span class="m-list_link-subtext">Closing' +
            '<span class="datetime">.*Aug. 5, 2099.*</span>'
            '</span></a>'
            '</li>'
        ))
Example #5
0
    def test_html_has_aside(self):
        block = JobListingList()
        html = block.render(block.to_python({}))

        self.assertHtmlRegexpMatches(
            html,
            ('^<aside class="m-jobs-list" data-qa-hook="openings-section">'
             '.*'
             '</aside>$'))
Example #6
0
    def test_html_has_aside(self):
        block = JobListingList()
        html = block.render(block.to_python({}))

        self.assertHtmlRegexpMatches(html, (
            '^<aside class="m-jobs-list" data-qa-hook="openings-section">'
            '.*'
            '</aside>$'
        ))
Example #7
0
    def test_html_has_ul(self):
        make_job_listing_page(title='Manager',
                              grades=['1', '2', '3'],
                              close_date=date(2099, 8, 5))

        block = JobListingList()
        html = block.render(block.to_python({}),
                            context={'request': self.request})

        self.assertHtmlRegexpMatches(
            html, ('<ul class="list list__unstyled">.*</ul>'))
Example #8
0
    def test_html_has_ul(self):
        make_job_listing_page(
            title='Manager',
            grades=['1', '2', '3'],
            close_date=date(2099, 8, 5)
        )

        block = JobListingList()
        html = block.render(
            block.to_python({}),
            context={'request': self.request}
        )

        self.assertHtmlRegexpMatches(html, (
            '<ul class="m-list m-list__unstyled">.*</ul>'
        ))
Example #9
0
 def test_includes_live_jobs(self):
     job = make_job_listing_page('Job', live=True)
     qs = JobListingList().get_queryset({})
     self.assertTrue(qs.exists())
     self.assertEqual(job.title, qs[0].title)
Example #10
0
 def test_excludes_draft_jobs(self):
     make_job_listing_page('Job', live=False)
     qs = JobListingList().get_queryset({})
     self.assertFalse(qs.exists())
Example #11
0
 def test_excludes_draft_jobs(self):
     make_job_listing_page('Job', live=False)
     qs = JobListingList().get_queryset({})
     self.assertFalse(qs.exists())
Example #12
0
 def _render_block_to_html(self):
     block = JobListingList()
     return block.render(block.to_python({
         'more_jobs_page': self.more_jobs_page.pk,
     }))
Example #13
0
 def test_includes_live_jobs(self):
     job = make_job_listing_page('Job', live=True)
     qs = JobListingList().get_queryset({})
     self.assertTrue(qs.exists())
     self.assertEqual(job.title, qs[0].title)
Example #14
0
 def _render_block_to_html(self):
     block = JobListingList()
     return block.render(
         block.to_python({
             'more_jobs_page': self.more_jobs_page.pk,
         }))