'Scenario: View Certificate option should be present on Course Progress menu if the user is
awarded a certificate.
And their should be no padding around the box containing certificate info. (See SOL-1196 for details on this)
As a Student
Given there is a course with certificate configuration
And I have passed the course and certificate is generated
When I go on the Progress tab for the course
Then I should see a \'View Certificate\' button
And their should be no padding around Certificate info box.'

def test_progress_page_has_view_certificate_button(self):

    self.cert_fixture.install()
    self.log_in_as_unique_user()
    self.complete_course_problems()
    self.course_info_page.visit()
    self.tab_nav.go_to_tab('Progress')
    self.assertTrue(self.progress_page.q(css='.auto-cert-message').first.visible)
    actual_padding = get_element_padding(self.progress_page, '.wrapper-msg.wrapper-auto-cert')
    actual_padding = [int(padding) for padding in actual_padding.itervalues()]
    expected_padding = [0, 0, 0, 0]
    self.assertEqual(actual_padding, expected_padding)
