'Scenario: On the Certificates tab of the Instructor Dashboard, Instructor should see error message if
the student entered for certificate invalidation does not exist.
Given that I am on the certificates tab on the Instructor Dashboard
When I click "Invalidate Certificate"
AND the username entered does not exist in the system
Then I see following error message
"Student username/email field is required and can not be empty."
"Kindly fill in username/email and then press "Invalidate Certificate" button."'

def test_error_on_invalid_user(self):

    invalid_user = 'invalid_test_user'
    self.certificates_section.fill_certificate_invalidation_user_name_field(invalid_user)
    self.certificates_section.click_invalidate_certificate_button()
    self.certificates_section.wait_for_ajax()
    self.assertIn(u'{user}    does    not    exist    in    the    LMS.    Please    check    your    spelling    and    retry.'.format(user=invalid_user), self.certificates_section.certificate_invalidation_message.text)
