Skip to content

Instantly share code, notes, and snippets.

@julianvargasalvarez
Created January 16, 2015 21:08
Show Gist options
  • Save julianvargasalvarez/eae927dd02700c7c3e5c to your computer and use it in GitHub Desktop.
Save julianvargasalvarez/eae927dd02700c7c3e5c to your computer and use it in GitHub Desktop.
def test_when_a_user_with_inactive_account_login_the_body_show_correctly_a_error_message(self):
RegistrationProfile.objects.create_inactive_user("jefree", "jgarzon920429@gmail.com", "1234", "", False)
self.selenium.get('%s%s' % (self.live_server_url, '/accounts/login/'))
username_input = self.selenium.find_element_by_name("username")
username_input.send_keys('jefree')
password_input = self.selenium.find_element_by_name("password")
password_input.send_keys('1234')
self.selenium.find_element_by_xpath('//input[@value="Log in"]').click()
body = self.selenium.find_element_by_tag_name('body')
self.assertIn("This account is inactive", body.text)
self.assertNotIn("__all__", body.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment