Example #1
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))

        table = JobListingTable()
        html = table.render(table.to_python({}))

        self.assertHtmlRegexpMatches(
            html,
            ('<tr>'
             '<td data-label="TITLE"><a class="" href=".*">Assistant</a></td>'
             '<td data-label="GRADE">12</td>'
             '<td data-label="POSTING CLOSES">APR 21, 2099</td>'
             '<td data-label="REGION">Silicon Valley</td>'
             '</tr>'
             '<tr>'
             '<td data-label="TITLE"><a class="" href=".*">Manager</a></td>'
             '<td data-label="GRADE">1, 2, 3</td>'
             '<td data-label="POSTING CLOSES">AUG 05, 2099</td>'
             '<td data-label="REGION">Silicon Valley</td>'
             '</tr>'))
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']
        )

        table = JobListingTable()
        html = table.render(table.to_python({}))

        self.assertHtmlRegexpMatches(html, (
            '<tr>'
            '<td data-label="TITLE"><a class="" href=".*">Assistant</a></td>'
            '<td data-label="GRADE">12</td>'
            '<td data-label="POSTING CLOSES">APR 21, 2099</td>'
            '<td data-label="REGION">Silicon Valley</td>'
            '</tr>'
            '<tr>'
            '<td data-label="TITLE"><a class="" href=".*">Manager</a></td>'
            '<td data-label="GRADE">1, 2, 3</td>'
            '<td data-label="POSTING CLOSES">AUG 05, 2099</td>'
            '<td data-label="REGION">DC, NY</td>'
            '</tr>'
        ))
Example #3
0
    def test_html_displays_no_data_message(self):
        table = JobListingTable()
        html = table.render(table.to_python({'empty_table_msg': 'No Jobs'}))

        self.assertHtmlRegexpMatches(html, (
            '<h3>No Jobs</h3>'
        ))
Example #4
0
    def test_html_has_table(self):
        table = JobListingTable()
        html = table.render(table.to_python({}))

        self.assertHtmlRegexpMatches(html, (
            '^<table class="o-table table__stack-on-small">'
            '.*'
            '</table>$'
        ))
Example #5
0
    def test_html_has_table(self):
        table = JobListingTable()
        html = table.render(table.to_python({}))

        self.assertHtmlRegexpMatches(html, (
            '^<table class="o-table o-table__stack-on-small">'
            '.*'
            '</table>$'
        ))
Example #6
0
    def test_html_displays_table_if_row_flag_false(self):
        table = JobListingTable()
        html = table.render(
            table.to_python({'first_row_is_table_header': False}))

        self.assertHtmlRegexpMatches(html, ('<tr>'
                                            '<td>TITLE</td>'
                                            '<td>GRADE</td>'
                                            '<td>POSTING CLOSES</td>'
                                            '<td>REGION</td>'
                                            '</tr>'))
Example #7
0
 def test_html_displays_single_row(self):
     make_job_listing_page(
         title='CEO',
         close_date=date(2099, 12, 1)
     )
     table = JobListingTable()
     html = table.render(table.to_python({}))
     self.assertHtmlRegexpMatches(html, (
         '<tr>'
         '.*'
         '</tr>'
     ))
Example #8
0
    def test_html_displays_single_row(self):
        make_job_listing_page(title='CEO', close_date=date(2099, 12, 1))
        table = JobListingTable()
        html = table.render(table.to_python({}))

        self.assertHtmlRegexpMatches(html,
                                     ('<tr>'
                                      '<th scope="col">TITLE</th>'
                                      '<th scope="col">GRADE</th>'
                                      '<th scope="col">POSTING CLOSES</th>'
                                      '<th scope="col">REGION</th>'
                                      '</tr>'))
Example #9
0
    def test_html_formatting_no_grade(self):
        make_job_listing_page(title='CEO', close_date=date(2099, 12, 1))

        table = JobListingTable()
        html = table.render(table.to_python({}))

        self.assertHtmlRegexpMatches(
            html, ('<tr>'
                   '<td data-label="TITLE"><a class="" href=".*">CEO</a></td>'
                   '<td data-label="GRADE"></td>'
                   '<td data-label="POSTING CLOSES">DEC 01, 2099</td>'
                   '<td data-label="REGION">Silicon Valley</td>'
                   '</tr>'))
Example #10
0
    def test_html_has_header(self):
        table = JobListingTable()
        html = table.render(table.to_python({}))

        self.assertHtmlRegexpMatches(html, (
            '<thead>'
            '<tr>'
            '<th scope="col">TITLE</th>'
            '<th scope="col">GRADE</th>'
            '<th scope="col">POSTING CLOSES</th>'
            '<th scope="col">REGION</th>'
            '</tr>'
            '</thead>'
        ))
Example #11
0
    def test_html_has_header(self):
        table = JobListingTable()
        html = table.render(table.to_python({}))

        self.assertHtmlRegexpMatches(html, (
            '<thead>'
            '<tr>'
            '<th scope="col">TITLE</th>'
            '<th scope="col">GRADE</th>'
            '<th scope="col">POSTING CLOSES</th>'
            '<th scope="col">REGION</th>'
            '</tr>'
            '</thead>'
        ))
Example #12
0
    def test_html_displays_table_if_row_flag_false(self):
        table = JobListingTable()
        html = table.render(table.to_python(
            {'first_row_is_table_header': False}
        ))

        self.assertHtmlRegexpMatches(html, (
            '<tr>'
            '<td>TITLE</td>'
            '<td>GRADE</td>'
            '<td>POSTING CLOSES</td>'
            '<td>REGION</td>'
            '</tr>'
        ))
Example #13
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)
        )

        table = JobListingTable()
        html = table.render(table.to_python({}))

        self.assertHtmlRegexpMatches(html, (
            'TITLE'
            '.*'
            'Assistant'
            '.*'
            'GRADE'
            '.*'
            '12'
            '.*'
            'POSTING CLOSES'
            '.*'
            'Apr. 21, 2099'
            '.*'
            'LOCATION'
            '.*'
            'Silicon Valley'
            '.*'
            'TITLE'
            '.*'
            'Manager'
            '.*'
            'GRADE'
            '.*'
            '1, 2, 3'
            '.*'
            'POSTING CLOSES'
            '.*'
            'Aug. 5, 2099'
            '.*'
            'LOCATION'
            '.*'
            'Silicon Valley'
        ))
Example #14
0
    def test_html_displays_table_if_row_flag_false(self):
        table = JobListingTable()
        html = table.render(
            table.to_python({'first_row_is_table_header': False}))

        self.assertHtmlRegexpMatches(html, ('<tr>'
                                            '.*'
                                            'TITLE'
                                            '.*'
                                            'GRADE'
                                            '.*'
                                            'POSTING CLOSES'
                                            '.*'
                                            'LOCATION'
                                            '.*'
                                            '</tr>'))
Example #15
0
    def test_html_displays_single_row(self):
        make_job_listing_page(
            title='CEO',
            close_date=date(2099, 12, 1)
        )
        table = JobListingTable()
        html = table.render(table.to_python({}))

        self.assertHtmlRegexpMatches(html, (
            '<tr>'
            '<th scope="col">TITLE</th>'
            '<th scope="col">GRADE</th>'
            '<th scope="col">POSTING CLOSES</th>'
            '<th scope="col">REGION</th>'
            '</tr>'
        ))
Example #16
0
    def test_html_formatting_no_grade_or_region(self):
        make_job_listing_page(
            title='CEO',
            close_date=date(2099, 12, 1)
        )

        table = JobListingTable()
        html = table.render(table.to_python({}))

        self.assertHtmlRegexpMatches(html, (
            '<tr>'
            '<td data-label="TITLE"><a class="" href=".*">CEO</a></td>'
            '<td data-label="GRADE"></td>'
            '<td data-label="POSTING CLOSES">DEC 01, 2099</td>'
            '<td data-label="REGION"></td>'
            '</tr>'
        ))
Example #17
0
    def test_html_formatting_no_grade(self):
        make_job_listing_page(title='CEO', close_date=date(2099, 12, 1))

        table = JobListingTable()
        html = table.render(table.to_python({}))

        self.assertHtmlRegexpMatches(html, ('TITLE'
                                            '.*'
                                            'CEO'
                                            '.*'
                                            'GRADE'
                                            '.*'
                                            'POSTING CLOSES'
                                            '.*'
                                            'Dec. 1, 2099'
                                            '.*'
                                            'LOCATION'
                                            '.*'
                                            'Silicon Valley'))
Example #18
0
    def test_html_displays_table_if_row_flag_false(self):
        table = JobListingTable()
        html = table.render(table.to_python(
            {'first_row_is_table_header': False}
        ))

        self.assertHtmlRegexpMatches(html, (
            '<tr>'
            '.*'
            'TITLE'
            '.*'
            'GRADE'
            '.*'
            'POSTING CLOSES'
            '.*'
            'LOCATION'
            '.*'
            '</tr>'
        ))
Example #19
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))

        table = JobListingTable()
        html = table.render(table.to_python({}))

        self.assertHtmlRegexpMatches(html, ('TITLE'
                                            '.*'
                                            'Assistant'
                                            '.*'
                                            'GRADE'
                                            '.*'
                                            '12'
                                            '.*'
                                            'POSTING CLOSES'
                                            '.*'
                                            'Apr. 21, 2099'
                                            '.*'
                                            'LOCATION'
                                            '.*'
                                            'Silicon Valley'
                                            '.*'
                                            'TITLE'
                                            '.*'
                                            'Manager'
                                            '.*'
                                            'GRADE'
                                            '.*'
                                            '1, 2, 3'
                                            '.*'
                                            'POSTING CLOSES'
                                            '.*'
                                            'Aug. 5, 2099'
                                            '.*'
                                            'LOCATION'
                                            '.*'
                                            'Silicon Valley'))
Example #20
0
    def test_html_formatting_no_grade(self):
        make_job_listing_page(
            title='CEO',
            close_date=date(2099, 12, 1)
        )

        table = JobListingTable()
        html = table.render(table.to_python({}))

        self.assertHtmlRegexpMatches(html, (
            'TITLE'
            '.*'
            'CEO'
            '.*'
            'GRADE'
            '.*'
            'POSTING CLOSES'
            '.*'
            'Dec. 1, 2099'
            '.*'
            'LOCATION'
            '.*'
            'Silicon Valley'
        ))
Example #21
0
    def test_html_has_header(self):
        make_job_listing_page(title='CEO', close_date=date(2099, 12, 1))
        table = JobListingTable()
        html = table.render(table.to_python({}))

        self.assertHtmlRegexpMatches(html, ('<thead>' '.*' '</thead>'))
Example #22
0
    def test_html_displays_no_data_message(self):
        table = JobListingTable()
        html = table.render(table.to_python({'empty_table_msg': 'No Jobs'}))

        self.assertHtmlRegexpMatches(html, ('<h3>No Jobs</h3>'))