Beispiel #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>'
        ))
Beispiel #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>'
        ))
Beispiel #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>'))
    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>'
        ))
Beispiel #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>$'))
Beispiel #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>$'
        ))
Beispiel #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>'))
Beispiel #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>'
        ))
Beispiel #9
0
 def _render_block_to_html(self):
     block = JobListingList()
     return block.render(block.to_python({
         'more_jobs_page': self.more_jobs_page.pk,
     }))
Beispiel #10
0
 def _render_block_to_html(self):
     block = JobListingList()
     return block.render(
         block.to_python({
             'more_jobs_page': self.more_jobs_page.pk,
         }))