def test_signup(self): b = self.browser b.visit(self.live_server_url + "/account/signup/") # self.assertTrue(b.is_element_present_by_text('Use Facebook account')) # self.assertTrue(b.is_element_present_by_text('Use Google account')) b.fill_in("email", "*****@*****.**") b.fill_in("first_name", "Jane") b.fill_in("last_name", "Doe") b.fill_in("password1", "?P455W0rd!") b.fill_in("password2", "?P455W0rd!") b.click_button("Register") b.assert_element("h1", text="Verify Your E-mail Address", wait=True) # Test the email is right email = self.account_admin.latest_sent_email self.assertIsNotNone(email) self.assertEqual("*****@*****.**", email["To"]) url = find_url_in_email(email) self.assertIsNotNone(url) # Follow the link b.visit(url) b.click_button("Confirm", wait=True) # Now log in with our new account # TODO _why_? The user already logged in b.fill_in("login", "*****@*****.**", wait=True) b.fill_in("password", "?P455W0rd!") b.click_button("Sign In") b.wait_for_element("a", text="MY WORKFLOWS", wait=True)
def test_signup(self): b = self.browser b.visit(self.live_server_url + '/account/signup/') #self.assertTrue(b.is_element_present_by_text('Use Facebook account')) #self.assertTrue(b.is_element_present_by_text('Use Google account')) b.fill_in('email', '*****@*****.**') b.fill_in('first_name', 'Jane') b.fill_in('last_name', 'Doe') b.fill_in('password1', '?P455W0rd!') b.fill_in('password2', '?P455W0rd!') b.click_button('Register') b.assert_element('h1', text='Verify Your E-mail Address', wait=True) # Test the email is right email = self.account_admin.latest_sent_email self.assertIsNotNone(email) self.assertEqual('*****@*****.**', email['To']) url = find_url_in_email(email) self.assertIsNotNone(url) # Follow the link b.visit(url) b.click_button('Confirm', wait=True) # Now log in with our new account # TODO _why_? The user already logged in b.fill_in('login', '*****@*****.**', wait=True) b.fill_in('password', '?P455W0rd!') b.click_button('Sign In') b.wait_for_element('h3', text='WORKFLOWS', wait=True)
def _begin_password_reset_and_follow_email_to_form(self, email): # Asserts that the email is indeed one that can be reset self._begin_password_reset(email) self.browser.assert_element('h1', text='Instructions sent!') message = self.account_admin.latest_sent_email self.assertIsNotNone(message) self.assertEqual(email, message['To']) url = find_url_in_email(message) self.assertIsNotNone(url) self.browser.visit(url)
def test_remember_signup_locale(self): b = self.browser b.visit(self.live_server_url + "/account/signup/") switch_locale_django(b, "Ελληνικά") # self.assertTrue(b.is_element_present_by_text('Use Facebook account')) # self.assertTrue(b.is_element_present_by_text('Use Google account')) b.fill_in("email", "*****@*****.**") b.fill_in("first_name", "Jane") b.fill_in("last_name", "Doe") b.fill_in("password1", "?P455W0rd!") b.fill_in("password2", "?P455W0rd!") b.click_button("Εγγραφή") b.assert_element( "h1", text="Επιβεβαιώστε τη διεύθυνση του ηλ. ταχυδρομείου σας", wait=True) # Test the email is right email = self.account_admin.latest_sent_email self.assertIsNotNone(email) self.assertEqual("*****@*****.**", email["To"]) url = find_url_in_email(email) self.assertIsNotNone(url) # Follow the link b.visit(url) b.click_button("Επιβεβαίωση", wait=True) # Change locale to English and browse switch_locale_django(b, "English") b.click_link("Sign up", wait=True) b.assert_element('input[name="first_name"][placeholder="First name"]', wait=True) b.assert_element('button[type="submit"]', text="Register") b.click_link("Sign in") # Now log in with our new account # TODO _why_? The user already logged in b.fill_in("login", "*****@*****.**", wait=True) b.fill_in("password", "?P455W0rd!") b.click_button("Sign In") b.wait_for_element("a", text="ΟΙ ΡΟΈΣ ΕΡΓΑΣΙΏΝ ΜΟΥ") # After logout, page must still be in Greek. logout(b) b.assert_element('input[name="password"][placeholder="Συνθηματικό"]', wait=True) b.assert_element('button[type="submit"]', text="Σύνδεση")
def test_signup_el(self): b = self.browser b.visit(self.live_server_url + "/account/signup/") switch_locale_django(b, "Ελληνικά") # self.assertTrue(b.is_element_present_by_text('Use Facebook account')) # self.assertTrue(b.is_element_present_by_text('Use Google account')) b.fill_in("email", "*****@*****.**") b.fill_in("first_name", "Jane") b.fill_in("last_name", "Doe") b.fill_in("password1", "?P455W0rd!") b.fill_in("password2", "?P455W0rd!") b.click_button("Εγγραφή") b.assert_element( "h1", text="Επιβεβαιώστε τη διεύθυνση του ηλ. ταχυδρομείου σας", wait=True) # Test the email is right email = self.account_admin.latest_sent_email self.assertIsNotNone(email) self.assertEqual("*****@*****.**", email["To"]) url = find_url_in_email(email) self.assertIsNotNone(url) # Follow the link b.visit(url) b.click_button("Επιβεβαίωση", wait=True) # Now log in with our new account # TODO _why_? The user already logged in b.fill_in("login", "*****@*****.**", wait=True) b.fill_in("password", "?P455W0rd!") b.click_button("Σύνδεση") b.wait_for_element("a", text="ΟΙ ΡΟΈΣ ΕΡΓΑΣΙΏΝ ΜΟΥ")