def should_be_able_to_instantiate_without_passing_the_app_and_set_it_later(self):
        from flaskext.mongoalchemy import MongoAlchemy

        db = MongoAlchemy()
        assert db.session is None
        db.init_app(self.app)
        assert db.session is not None
示例#2
0
    def test_should_contain_a_not_none_query(self):
        "Document.query should never be None"
        db = MongoAlchemy()
        db.init_app(self.app)

        class Person(db.Document):
            name = db.StringField()

        p = Person()
        assert p.query is not None
    def test_should_contain_a_not_none_query(self):
        "Document.query should never be None"
        db = MongoAlchemy()
        db.init_app(self.app)

        class Person(db.Document):
            name = db.StringField()

        p = Person()
        assert p.query is not None
    def should_contain_a_not_none_query(self):
        "Document.query should never be None"
        from flaskext.mongoalchemy import MongoAlchemy

        db = MongoAlchemy()
        db.init_app(self.app)

        class Person(db.Document):
            name = db.StringField()

        p = Person()
        assert p.query is not None
示例#5
0
 def test_should_be_able_to_instantiate_without_passing_the_app_and_set_it_later(
         self):
     db = MongoAlchemy()
     assert db.session is None
     db.init_app(self.app)
     assert db.session is not None
 def test_should_be_able_to_instantiate_without_passing_the_app_and_set_it_later(self):
     db = MongoAlchemy()
     assert db.session is None
     db.init_app(self.app)
     assert db.session is not None