Ejemplo n.º 1
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
Ejemplo n.º 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
Ejemplo n.º 3
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
Ejemplo n.º 4
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