From a3f3ca68ca6ae64733b2520a1bb20f8ac8b7eb19 Mon Sep 17 00:00:00 2001 From: bill shelton Date: Mon, 13 Feb 2012 14:20:15 -0500 Subject: [PATCH] Make work with Mac - OK --- local_settings.py.template | 119 +++++++++++++++++++++ sqlite_db/transit_subsidy.db | Bin 52224 -> 58368 bytes tests/selenium/TransitSubsidyApp.py | 9 +- tests/selenium/base_test.py | 2 +- tests/selenium/transit_subsidy_ui_tests.py | 2 +- 5 files changed, 126 insertions(+), 6 deletions(-) create mode 100644 local_settings.py.template diff --git a/local_settings.py.template b/local_settings.py.template new file mode 100644 index 0000000..578f58c --- /dev/null +++ b/local_settings.py.template @@ -0,0 +1,119 @@ +# Django settings for intra project. +import sys +from django.contrib.staticfiles import views +from settings import * +from django.conf.urls.defaults import patterns, include, url + +#print sys.argv + +if 'test' in sys.argv: + # if 'test' is part of the comman then use sqlite3, else use mysql + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': './sqlite_db/transit_subsidy_testing.db', # Or path to database file if using sqlite3. + 'USER': '', # Not used with sqlite3. + 'PASSWORD': '', # Not used with sqlite3. + 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. + 'PORT': '', # Set to empty string for default. Not used with sqlite3. + # 'TEST_NAME' : 'bills_test_database_of_death', + }, + } +else: + DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. + 'NAME': './sqlite_db/transit_subsidy.db', # Or path to database file if using sqlite3. + 'USER': '', # Not used with sqlite3. + 'PASSWORD': '', # Not used with sqlite3. + 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. + 'PORT': '', # Set to empty string for default. Not used with sqlite3. + #'TEST_NAME' : 'bills_test_database_of_death', + }, + } + + + +DEPLOYED = True +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + # ('Your Name', 'your_email@example.com'), +) + +#overriding settings.py ...? Should be only during test? +AUTHENTICATION_BACKENDS = ( + 'django.contrib.auth.backends.ModelBackend', +) + +MANAGERS = ADMINS + + +# Works better than the Django default +TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' + +# Where Django Test finds fixture data +FIXTURE_DIRS = ( + '/Users/sheltonb/webapps/transit_subsidy_os/tests/fixtures', +) + +INSTALLED_APPS += ('django_nose','tests',) +# urlpatterns += ( url(r'^mobile/', 'mobile.views.index', ) ) + + + + +# Absolute filesystem path to the directory that will hold user-uploaded files. +# Example: "/home/media/media.lawrence.com/media/" +MEDIA_ROOT = '' + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash. +# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" +MEDIA_URL = '' + +# Absolute path to the directory static files should be collected to. +# Don't put anything in this directory yourself; store your static files +# in apps' "static/" subdirectories and in STATICFILES_DIRS. +# Example: "/home/media/media.lawrence.com/static/" +STATIC_ROOT = '' + +# URL prefix for static files. +# Example: "http://media.lawrence.com/static/" +STATIC_URL = '/static/' +#STATIC_URL = '/tests/coverage/' + + +# URL prefix for admin static files -- CSS, JavaScript and images. +# Make sure to use a trailing slash. +# Examples: "http://foo.com/static/admin/", "/static/admin/". +ADMIN_MEDIA_PREFIX = '/static/admin/' + +# Additional locations of static files +STATICFILES_DIRS = ( + # Put strings here, like "/home/html/static" or "C:/www/django/static". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + #('ps', '/var/www/django/intra/ps/static') + #'/home/cfpb/william.shelton/webapps/collab/tests/coverage/', +) + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '' + + + +TEMPLATE_DIRS = ( + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + #'/var/www/django/intra/templates/', + '/Users/sheltonb/webapps/transit_subsidy_os/templates', +) + + +EMAIL_HOST = 'localhost' +EMAIL_PORT = 25 +EMAIL_USE_TLS = False + diff --git a/sqlite_db/transit_subsidy.db b/sqlite_db/transit_subsidy.db index 673eaded91bcb473f69d9e20a9df0bc238da0789..71ab6a4ef0df57e5e0de441e8c61fa589aacd9b6 100644 GIT binary patch delta 3344 zcmcgvZD?EP6~6C%?Z|QDS#~VDshducKVmPf`hI_i(p9mYEFY3->tu@w4fiw7huzRP zP1aIWg^rDFY!mu37>q#~W$Z_*2uk;BCBI52?XN;$jBRv(wlY}%Y-`70@0Bd&+Ro7a zY!~tB>OIeS&$;KG^PHpCehgoGAO7g!QK+o#*TKeP_Y!d0`m~-HSl9#7z_LEA)qe8i zSRa@NNk6y}YzF7ogKO8E3&C`I(_3>kE_64iM*6@MNIJgXf#sTq_O3lPj7fp20>OD9 z7#6zuQ~nDuj9CFw^T}hx7^C$w@;h65ROYc}Na^NZwQt)MJ8aaB+6N|*{nli9a?3U6`sUi!ZL@OZTVOD0e`3K`;BW0un#skF?eSD! zdJ@D?$z0#zc~JlG$ie#fu|MbfO;jNKEQ*bW|Ac>Q-^N2#Pn`UGpqhpKrRp=q`tO!A z_3xc{wf^4mpU);*TN>*iq&&o~3>4>{a?Nu)LP=jc9BIeE*JTtF69JYdOi9A3FYWCw z-Fl_yDyCiTD}k^ZaO?_4FscoL6U_sr>Q9`!qm45vZ5BRk7PfcLtSRueW&gmwXMY)d z4Boc?1%Cst*o*KTn1eO@B0Od{!583*M$HG66Pz*E@v+p%_Z$ynghJzKD0qORr+qdt z4NE`-RD_|=JlEyYcZuf^Xvzk{M?u$^K5Uv{%vYR0?O+nh5c|j{L|{q%AfVjA+8iSTHW-2aa}FljNtkHXmTBh6s0vAe>%3MJ zDR~$qEC3QiML6`;f0(o~7eSajj>zMfW@2D$JiC3hlt>>a7K`brsmYNEqnZG6aREzI zcW*r1D(3dlQXwLmjT_IIVg?^s@Q?5g{2BCN&i=jqmVMJMnymdh_^45P3sh#O`z;LS z7o3eun{qN+#k_-oW~aKiHVbue+es;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ransitSubsidyApp.py @@ -103,8 +103,9 @@ def add_smartrip(self, num='00020 0001 5644 364 6'): def enroll(self): - self.driver.find_element_by_id("btn_enroll_smartrip").click() time.sleep(.5) + self.driver.find_element_by_id("btn_enroll_smartrip").click() + time.sleep(1) def sign(self, last_four_ssn='1234', signature='Mick Jagger'): @@ -133,9 +134,9 @@ def withdraw_enrollment(self): #In theaory, this should work, too: self.driver.find_element_by_id("cboxClose").click() - #OK - now let's cancel - self.driver.find_element_by_link_text('Cancel my enrollment.').click() - time.sleep(1) + #OK - now let' + self.driver.find_element_by_partial_link_text('Cancel my enrollment').click() + time.sleep(.5) self.driver.find_element_by_id("btn_withdraw_agree").click() eq_("Your Intranet > Transit Subsidy Withdrawl Confirmation", self.driver.title) diff --git a/tests/selenium/base_test.py b/tests/selenium/base_test.py index 548d222..14c8871 100644 --- a/tests/selenium/base_test.py +++ b/tests/selenium/base_test.py @@ -180,7 +180,7 @@ def new_driver(): _driver = webdriver.Remote( command_executor=os.environ['selenium_hub'], desired_capabilities=_capabilities ) - _driver.implicitly_wait(2) + _driver.implicitly_wait(5) return _driver diff --git a/tests/selenium/transit_subsidy_ui_tests.py b/tests/selenium/transit_subsidy_ui_tests.py index 91be334..24d3e59 100644 --- a/tests/selenium/transit_subsidy_ui_tests.py +++ b/tests/selenium/transit_subsidy_ui_tests.py @@ -32,7 +32,7 @@ def teardown_module(module): def first(): - pass + time.sleep(1) def last(): driver.get(base_url + "/logout")