Add tests for getdotattr

This commit is contained in:
Konsta Vesterinen
2014-02-18 13:42:54 +02:00
parent fc7ac78ff1
commit 73632cf9cb

View File

@@ -3,8 +3,7 @@ from sqlalchemy_utils.functions import getdotattr
from tests import TestCase from tests import TestCase
class TestGetDotAttr(TestCase):
class TestTwoWayAttributeValueGeneration(TestCase):
def create_models(self): def create_models(self):
class Document(self.Base): class Document(self.Base):
__tablename__ = 'document' __tablename__ = 'document'
@@ -22,7 +21,7 @@ class TestTwoWayAttributeValueGeneration(TestCase):
sa.Integer, sa.ForeignKey(Document.id) sa.Integer, sa.ForeignKey(Document.id)
) )
document = sa.orm.relationship(Document) document = sa.orm.relationship(Document, backref='sections')
class SubSection(self.Base): class SubSection(self.Base):
__tablename__ = 'subsection' __tablename__ = 'subsection'
@@ -34,7 +33,7 @@ class TestTwoWayAttributeValueGeneration(TestCase):
sa.Integer, sa.ForeignKey(Section.id) sa.Integer, sa.ForeignKey(Section.id)
) )
section = sa.orm.relationship(Section) section = sa.orm.relationship(Section, backref='subsections')
self.Document = Document self.Document = Document
self.Section = Section self.Section = Section