Skip to content

Commit

Permalink
fix broken test case
Browse files Browse the repository at this point in the history
  • Loading branch information
chfw committed May 16, 2015
1 parent 733d168 commit b76b298
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/source/sqlalchemy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Now suppose we have these more complex tables:

>>> from sqlalchemy import ForeignKey, DateTime
>>> from sqlalchemy.orm import relationship, backref
>>> import sys
>>> PY33 = (sys.version_info[0] == 3 and sys.version_info[1] == 3)
>>> class Post(Base):
... __tablename__ = 'post'
... id = Column(Integer, primary_key=True)
Expand All @@ -99,6 +101,8 @@ Now suppose we have these more complex tables:
... pub_date = datetime.utcnow()
... self.pub_date = pub_date
... self.category = category
... if PY33:
... self.category_id = category.id
...
... def __repr__(self):
... return '<Post %r>' % self.title
Expand Down
4 changes: 4 additions & 0 deletions tests/test_sql_book.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from pyexcel_io.sqlbook import SQLTableReader, SQLTableWriter
from sqlalchemy.orm import relationship, backref
from nose.tools import raises
import sys
PY33 = (sys.version_info[0] == 3 and sys.version_info[1] == 3)


engine=create_engine("sqlite:///tmp.db")
Expand Down Expand Up @@ -43,6 +45,8 @@ def __init__(self, title, body, category, pub_date=None):
pub_date = datetime.utcnow()
self.pub_date = pub_date
self.category = category
if PY33:
self.category_id = category.id

def __repr__(self):
return '<Post %r>' % self.title
Expand Down

0 comments on commit b76b298

Please sign in to comment.