From: Miguel Araujo Perez Date: Sun, 1 May 2011 12:40:01 +0000 (+0200) Subject: Adding Selenium2 Linkedin test. X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=c6b992215f8ff272980ca508bd9d9f2d535b0d30;p=django-social-auth.git Adding Selenium2 Linkedin test. --- diff --git a/contrib/tests/test_core.py b/contrib/tests/test_core.py index bb729de..59bd8b4 100644 --- a/contrib/tests/test_core.py +++ b/contrib/tests/test_core.py @@ -122,3 +122,26 @@ class BackendsTest(TestCase): raise Exception("The user didn't logged in") # Here we could test the User's fields + + def test_linkedin_backend(self): + TEST_LINKEDIN_USER = getattr(settings, 'TEST_LINKEDIN_USER', None) + TEST_LINKEDIN_PASSWORD = getattr(settings, 'TEST_LINKEDIN_PASSWORD', None) + self.assertTrue(TEST_LINKEDIN_USER) + self.assertTrue(TEST_LINKEDIN_PASSWORD) + + self.driver.get("http://social.matiasaguirre.net/login/linkedin/") + + # We log in + username_field = self.driver.find_element_by_id("session_key-oauthAuthorizeForm") + username_field.send_keys(TEST_LINKEDIN_USER) + + password_field = self.driver.find_element_by_id("session_password-oauthAuthorizeForm") + password_field.send_keys(TEST_LINKEDIN_PASSWORD) + password_field.submit() + + # We check the user logged in + heading = self.driver.find_element_by_id("heading") + if not heading.text == u'Logged in!': + raise Exception("The user didn't logged in") + + # Here we could test the User's fields