예제 #1
0
def news_client(app, session, client):
    """Fixture for wiki tests.
    """
    from pygameweb.news.views import add_news_blueprint
    from pygameweb.user.views import add_user_blueprint
    add_user_blueprint(app)
    add_news_blueprint(app)
    return client
예제 #2
0
def project_client(app, session, client):
    """Fixture for wiki tests.
    """
    from pygameweb.project.views import add_project_blueprint
    from pygameweb.user.views import add_user_blueprint
    from pygameweb.sidebar.views import add_sidebar
    from pygameweb.thumb.views import add_thumb_blueprint
    add_sidebar(app)
    add_user_blueprint(app)
    add_project_blueprint(app)
    add_thumb_blueprint(app)

    return client
예제 #3
0
def add_views_front(app):
    """ Adds all the front end views to the app.

    Kept separate from create_app so we can test individual views.
    """
    # We catch HTTPException to handle all HTTP error codes
    from werkzeug.exceptions import HTTPException

    # add_user_blueprint does some monkey patching, so it needs to be first.
    from pygameweb.user.views import add_user_blueprint
    add_user_blueprint(app)
    upgrade_https_urls(app)

    from pygameweb.wiki.views import add_wiki_blueprint
    from pygameweb.project.views import add_project_blueprint
    from pygameweb.static.views import add_static_blueprint
    from pygameweb.thumb.views import add_thumb_blueprint
    from pygameweb.news.views import add_news_blueprint
    from pygameweb.nav.views import add_nav
    from pygameweb.page.views import add_page
    from pygameweb.sidebar.views import add_sidebar
    from pygameweb.dashboard.views import add_dashboard
    from pygameweb.builds.views import add_builds
    from pygameweb.comment.views import add_comment

    app.errorhandler(HTTPException)(http_error_handler)
    app.errorhandler(Exception)(error_handler)

    add_wiki_blueprint(app)
    add_project_blueprint(app)
    add_thumb_blueprint(app)
    add_static_blueprint(app)
    add_news_blueprint(app)
    add_dashboard(app)
    add_page(app)
    add_sidebar(app)
    add_builds(app)
    add_comment(app)

    # nav should be last, since it uses other routes.
    add_nav(app)
    if app.config['ADMIN']:
        from pygameweb.admin.views import add_admin
        add_admin(app)
예제 #4
0
def add_views_front(app):
    """ Adds all the front end views to the app.

    Kept separate from create_app so we can test individual views.
    """
    # add_user_blueprint does some monkey patching, so it needs to be first.
    from pygameweb.user.views import add_user_blueprint
    add_user_blueprint(app)

    from pygameweb.wiki.views import add_wiki_blueprint
    from pygameweb.project.views import add_project_blueprint
    from pygameweb.static.views import add_static_blueprint
    from pygameweb.thumb.views import add_thumb_blueprint
    from pygameweb.news.views import add_news_blueprint
    from pygameweb.nav.views import add_nav
    from pygameweb.page.views import add_page
    from pygameweb.sidebar.views import add_sidebar
    from pygameweb.dashboard.views import add_dashboard
    from pygameweb.builds.views import add_builds
    from pygameweb.comment.views import add_comment

    from pygameweb.admin.views import add_admin
    add_wiki_blueprint(app)
    add_project_blueprint(app)
    add_thumb_blueprint(app)
    add_static_blueprint(app)
    add_news_blueprint(app)
    add_dashboard(app)
    add_page(app)
    add_sidebar(app)
    add_builds(app)
    add_comment(app)

    # nav should be last, since it uses other routes.
    add_nav(app)
    add_admin(app)