Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added tests to models #2

Merged
merged 4 commits into from
Apr 17, 2011
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
disabled debug in models tests
  • Loading branch information
virhilo committed Apr 11, 2011
commit 2955559efcc92390abbec70ba5afbf46f2ffbecc
1 change: 1 addition & 0 deletions shootout/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ class Idea(Base):
voted_users = relation(User, secondary=voted_users, lazy='dynamic',
backref='voted_ideas')
hit_percentage = func.coalesce(hits / (hits + misses) * 100, 0)

hit_percentage = column_property(hit_percentage.label('hit_percentage'))

total_votes = column_property((hits + misses).label('total_votes'))
Expand Down
2 changes: 1 addition & 1 deletion shootout/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def _initTestingDB():
from shootout.models import DBSession
from shootout.models import Base
from sqlalchemy import create_engine
engine = create_engine('sqlite://', echo='debug')
engine = create_engine('sqlite://')
session = DBSession()
session.configure(bind=engine)
Base.metadata.bind = engine
Expand Down