Skip to content

Commit

Permalink
Make work with Mac - OK
Browse files Browse the repository at this point in the history
  • Loading branch information
virtix committed Feb 13, 2012
1 parent c62171e commit a3f3ca6
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 6 deletions.
119 changes: 119 additions & 0 deletions 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

Binary file modified sqlite_db/transit_subsidy.db
Binary file not shown.
9 changes: 5 additions & 4 deletions tests/selenium/TransitSubsidyApp.py
Expand Up @@ -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'):
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion tests/selenium/base_test.py
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion tests/selenium/transit_subsidy_ui_tests.py
Expand Up @@ -32,7 +32,7 @@ def teardown_module(module):


def first():
pass
time.sleep(1)

def last():
driver.get(base_url + "/logout")
Expand Down

0 comments on commit a3f3ca6

Please sign in to comment.