Beispiel #1
0
def test_contact_page():

    @extends(contact_page.contact_page)
    class Index(Webmaster):
        pass

    app = Webmaster.init(__name__, config=config)
    app.testing = True

    with app.test_client() as c:
        data = c.get("/contact").data
Beispiel #2
0
This is the entry point of the application.

--------------------------------------------------------------------------------

** To serve the local development app

> webcli local -a {project_name}

#---------

** To deploy with Propel ( https://github.com/mardix/propel )

> propel -w

#---------

** To deploy with Gunicorn

> gunicorn app_{project_name}:app

"""

from webmaster import Webmaster

# Import the application's views
import application.{project_name}.views

# 'app' variable name is required if you intend to use it with 'webcli'
app = Webmaster.init(__name__, project="{project_name}")

Beispiel #3
0

from flask import Flask
import flask_cache
import ses_mailer
import flask_mail
import flask_cloudy
import flask_recaptcha

from webmaster import Webmaster, mailer, cache, storage, recaptcha

conffile = "config.Test"

app = Webmaster.init(__name__, config=conffile)


# Recaptcha
def test_recaptcha():
    assert isinstance(recaptcha, flask_recaptcha.ReCaptcha)

# Storage
def test_storage():
    assert isinstance(storage, flask_cloudy.Storage)

# Cache
def test_cache():
    assert isinstance(cache, flask_cache.Cache)

# Mailer
def test_mailer_none():
    assert mailer.mail is None