Did I find the right examples for you? yes no

All Samples(11)  |  Call(11)  |  Derive(0)  |  Import(0)

src/f/l/flask-couchdbkit-HEAD/tests/test_couchdbkit.py   flask-couchdbkit(Download)
    def test_create(self):
        with self.app.app_context():
            todo = self.Todo(title='First Todo', text='Some text.')
            todo.save()
            self.assertTrue(self.db.doc_exist(todo._id))
    def test_retrieve(self):
        with self.app.app_context():
            todo = self.Todo(title='2nd Todo', text='Some text.')
            todo.save()
            retrieved = self.Todo.get(todo._id)
        def add():
            form = flask.request.form
            todo = self.Todo(title=form['title'], text=form['text'])
            todo.save()
            return 'added'

src/f/l/flask-mongoengine-HEAD/tests/test_basic_app.py   flask-mongoengine(Download)
        def add():
            form = flask.request.form
            todo = self.Todo(title=form['title'],
                             text=form['text'])
            todo.save()
    def test_request_context(self):
        with self.app.test_request_context():
            todo = self.Todo(title='Test', text='test')
            todo.save()
            self.assertEqual(self.Todo.objects.count(), 1)

src/f/l/Flask-SQLAlchemy-1.0/test_sqlalchemy.py   Flask-SQLAlchemy(Download)
        def add():
            form = flask.request.form
            todo = self.Todo(form['title'], form['text'])
            db.session.add(todo)
            db.session.commit()
    def test_query_recording(self):
        with self.app.test_request_context():
            todo = self.Todo('Test 1', 'test')
            self.db.session.add(todo)
            self.db.session.commit()
        with sqlalchemy.models_committed.connected_to(committed,
                                                      sender=self.app):
            todo = self.Todo('Awesome', 'the text')
            self.db.session.add(todo)
            self.assertEqual(len(recorded), 0)

src/f/l/flask-sqlalchemy-HEAD/test_sqlalchemy.py   flask-sqlalchemy(Download)
        def add():
            form = flask.request.form
            todo = self.Todo(form['title'], form['text'])
            db.session.add(todo)
            db.session.commit()
    def test_query_recording(self):
        with self.app.test_request_context():
            todo = self.Todo('Test 1', 'test')
            self.db.session.add(todo)
            self.db.session.commit()
        with sqlalchemy.models_committed.connected_to(committed,
                                                      sender=self.app):
            todo = self.Todo('Awesome', 'the text')
            self.db.session.add(todo)
            self.assertEqual(len(recorded), 0)