From de2908ef76912894128285ec6da88e355df6e28f Mon Sep 17 00:00:00 2001 From: Miguel Araujo Perez Date: Sun, 1 May 2011 12:39:53 +0200 Subject: [PATCH] Moving Selenium2 testing to contrib directory as discussed in GH-25 --- social_auth/tests/runtests.py | 22 ---------------- social_auth/tests/test_core.py | 42 ------------------------------ social_auth/tests/test_settings.py | 16 ------------ 3 files changed, 80 deletions(-) delete mode 100755 social_auth/tests/runtests.py delete mode 100644 social_auth/tests/test_core.py delete mode 100644 social_auth/tests/test_settings.py diff --git a/social_auth/tests/runtests.py b/social_auth/tests/runtests.py deleted file mode 100755 index 7ff2e20..0000000 --- a/social_auth/tests/runtests.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python - -import os, sys - -os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings' -parent = os.path.dirname(os.path.dirname(os.path.dirname( - os.path.abspath(__file__)))) - -sys.path.insert(0, parent) - -from django.test.simple import run_tests -from django.conf import settings - -def runtests(): - failures = run_tests([ - 'social_auth.BackendTest', - ], verbosity=1, interactive=True) - sys.exit(failures) - -if __name__ == '__main__': - runtests() - diff --git a/social_auth/tests/test_core.py b/social_auth/tests/test_core.py deleted file mode 100644 index 79484f7..0000000 --- a/social_auth/tests/test_core.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- -from selenium import webdriver - -from django.test import TestCase -from django.conf import settings - - -class BackendTest(TestCase): - def setUp(self): - self.driver = webdriver.Firefox() - - def test_twitter_backend(self): - # We grab the Twitter testing user details from settings file - TEST_TWITTER_USER = getattr(settings, 'TEST_TWITTER_USER', None) - TEST_TWITTER_PASSWORD = getattr(settings, 'TEST_TWITTER_PASSWORD', None) - self.assertTrue(TEST_TWITTER_USER) - self.assertTrue(TEST_TWITTER_PASSWORD) - - self.driver.get("http://social.matiasaguirre.net/login/twitter/") - - # We log in - username_field = self.driver.find_element_by_id("username_or_email") - username_field.send_keys(TEST_TWITTER_USER) - - password_field = self.driver.find_element_by_id("session[password]") - password_field.send_keys(TEST_TWITTER_PASSWORD) - password_field.submit() - - # The application might be already allowed - try: - self.driver.find_element_by_id("allow").click() - except: - pass - - # 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 - - self.driver.quit() diff --git a/social_auth/tests/test_settings.py b/social_auth/tests/test_settings.py deleted file mode 100644 index 6f147fd..0000000 --- a/social_auth/tests/test_settings.py +++ /dev/null @@ -1,16 +0,0 @@ -import os - -BASE_DIR = os.path.dirname(__file__) - -INSTALLED_APPS = ( - 'social_auth', -) - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - } -} - -TEST_TWITTER_USER = "" -TEST_TWITTER_PASSWORD = "" -- 2.39.5