Example #1
0
 def setUp(self):
     self.ctx = self.app.test_request_context()
     self.ctx.push()
     db.create_all()
     self.session = db.session
     # SQLAlchemy doesn't fire mapper_configured events until the first time a mapping is used
     IdOnly()
Example #2
0
 def setUp(self):
     self.ctx = self.app.test_request_context()
     self.ctx.push()
     db.create_all()
     self.session = db.session
     # SQLAlchemy doesn't fire mapper_configured events until the first time a mapping is used
     IdOnly()
Example #3
0
 def setUp(self):
     self.ctx = self.app.test_request_context()
     self.ctx.push()
     db.create_all()
     self.session = db.session
     # SQLAlchemy doesn't fire mapper_configured events until the first time a
     # mapping is used, or configuration is explicitly requested
     db.configure_mappers()
Example #4
0
    def setUp(self):
        self.ctx = self.app.test_request_context()
        self.ctx.push()

        db.create_all()
        self.session = db.session
        c = Container(name=u'c')
        self.session.add(c)
        self.container = c
        self.nd1 = NamedDocument(container=c, title=u"Named Document")
        self.session.add(self.nd1)
        self.session.commit()
        self.nd2 = NamedDocument(container=c, title=u"Another Named Document")
        self.session.add(self.nd2)
        self.session.commit()
        self.rd1 = RedirectDocument(container=c, title=u"Redirect Document", target=self.nd1)
        self.session.add(self.rd1)
        self.session.commit()
        self.snd1 = ScopedNamedDocument(container=c, title=u"Scoped Named Document")
        self.session.add(self.snd1)
        self.session.commit()
        self.snd2 = ScopedNamedDocument(container=c, title=u"Another Scoped Named Document")
        self.session.add(self.snd2)
        self.session.commit()
        self.ind1 = IdNamedDocument(container=c, title=u"Id Named Document")
        self.session.add(self.ind1)
        self.session.commit()
        self.ind2 = IdNamedDocument(container=c, title=u"Another Id Named Document")
        self.session.add(self.ind2)
        self.session.commit()
        self.sid1 = ScopedIdDocument(container=c)
        self.session.add(self.sid1)
        self.session.commit()
        self.sid2 = ScopedIdDocument(container=c)
        self.session.add(self.sid2)
        self.session.commit()
        self.sind1 = ScopedIdNamedDocument(container=c, title=u"Scoped Id Named Document")
        self.session.add(self.sind1)
        self.session.commit()
        self.sind2 = ScopedIdNamedDocument(container=c, title=u"Another Scoped Id Named Document")
        self.session.add(self.sind2)
        self.session.commit()
        self.pc = ParentDocument(title=u"Parent")
        self.session.add(self.pc)
        self.session.commit()
        self.child1 = ChildDocument(parent=self.pc.middle)
        self.session.add(self.child1)
        self.session.commit()
        self.child2 = ChildDocument(parent=self.pc.middle)
        self.session.add(self.child2)
        self.session.commit()
        self.app = Flask(__name__)
        self.app.add_url_rule('/<container>/<document>', 'redirect_document', t_redirect_document)
Example #5
0
 def setUp(self):
     self.ctx = self.app.test_request_context()
     self.ctx.push()
     db.create_all()
     self.session = db.session
Example #6
0
 def setUp(self):
     self.ctx = app.test_request_context()
     self.ctx.push()
     db.create_all()
     self.session = db.session
    def setUp(self):
        self.ctx = self.app.test_request_context()
        self.ctx.push()

        db.create_all()
        self.session = db.session
        c = Container(name=u'c')
        self.session.add(c)
        self.container = c
        self.nd1 = NamedDocument(container=c, title=u"Named Document")
        self.session.add(self.nd1)
        self.session.commit()
        self.nd2 = NamedDocument(container=c, title=u"Another Named Document")
        self.session.add(self.nd2)
        self.session.commit()
        self.rd1 = RedirectDocument(container=c,
                                    title=u"Redirect Document",
                                    target=self.nd1)
        self.session.add(self.rd1)
        self.session.commit()
        self.snd1 = ScopedNamedDocument(container=c,
                                        title=u"Scoped Named Document")
        self.session.add(self.snd1)
        self.session.commit()
        self.snd2 = ScopedNamedDocument(container=c,
                                        title=u"Another Scoped Named Document")
        self.session.add(self.snd2)
        self.session.commit()
        self.ind1 = IdNamedDocument(container=c, title=u"Id Named Document")
        self.session.add(self.ind1)
        self.session.commit()
        self.ind2 = IdNamedDocument(container=c,
                                    title=u"Another Id Named Document")
        self.session.add(self.ind2)
        self.session.commit()
        self.sid1 = ScopedIdDocument(container=c)
        self.session.add(self.sid1)
        self.session.commit()
        self.sid2 = ScopedIdDocument(container=c)
        self.session.add(self.sid2)
        self.session.commit()
        self.sind1 = ScopedIdNamedDocument(container=c,
                                           title=u"Scoped Id Named Document")
        self.session.add(self.sind1)
        self.session.commit()
        self.sind2 = ScopedIdNamedDocument(
            container=c, title=u"Another Scoped Id Named Document")
        self.session.add(self.sind2)
        self.session.commit()
        self.pc = ParentDocument(title=u"Parent")
        self.session.add(self.pc)
        self.session.commit()
        self.child1 = ChildDocument(parent=self.pc.middle)
        self.session.add(self.child1)
        self.session.commit()
        self.child2 = ChildDocument(parent=self.pc.middle)
        self.session.add(self.child2)
        self.session.commit()
        self.app = Flask(__name__)
        self.app.add_url_rule('/<container>/<document>', 'redirect_document',
                              t_redirect_document)