def test_view(app):
    """Test view."""
    Babel(app)
    projectwithsharedtask(app)
    with app.test_client() as client:
        res = client.get("/")
        assert res.status_code == 200
        assert 'Welcome to projectwithsharedtask' in str(res.data)
Пример #2
0
def test_view(app):
    """Test view."""
    Babel(app)
    projectwithsharedtask(app)
    with app.test_client() as client:
        res = client.get("/")
        assert res.status_code == 200
        assert 'Welcome to projectwithsharedtask' in str(res.data)
def test_init():
    """Test extension initialization."""
    app = Flask('testapp')
    ext = projectwithsharedtask(app)
    assert 'projectwithsharedtask' in app.extensions

    app = Flask('testapp')
    ext = projectwithsharedtask()
    assert 'projectwithsharedtask' not in app.extensions
    ext.init_app(app)
    assert 'projectwithsharedtask' in app.extensionssrc
Пример #4
0
def test_init():
    """Test extension initialization."""
    app = Flask('testapp')
    ext = projectwithsharedtask(app)
    assert 'projectwithsharedtask' in app.extensions

    app = Flask('testapp')
    ext = projectwithsharedtask()
    assert 'projectwithsharedtask' not in app.extensions
    ext.init_app(app)
    assert 'projectwithsharedtask' in app.extensionssrc
# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307, USA.
#
# In applying this license, CERN does not
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.
"""Minimal Flask application example for development.

Run example development server:

.. code-block:: console

   $ cd examples
   $ python app.py
"""

from __future__ import absolute_import, print_function

from flask import Flask
from flask_babelex import Babel

from projectwithsharedtask import projectwithsharedtask

# Create Flask application
app = Flask(__name__)
Babel(app)
projectwithsharedtask(app)

if __name__ == "__main__":
    app.run()