Exemple #1
0
def app(request):
    """Session-wide test `Flask` application."""
    app = create_app('testing')
    app.config['WTF_CSRF_ENABLED'] = False
    # Establish an application context before running the tests.
    ctx = app.app_context()
    ctx.push()

    def teardown():
        ctx.pop()

    request.addfinalizer(teardown)
    return app
Exemple #2
0
#!/usr/bin/python

import argparse
from datetime import datetime
import sys
import random

from OpenOversight.app import create_app, models
from OpenOversight.app.models import db

app = create_app('development')
db.app = app

NUM_OFFICERS = app.config['NUM_OFFICERS']
random.seed(app.config['SEED'])


OFFICERS = [('IVANA', '', 'TINKLE'),
            ('SEYMOUR', '', 'BUTZ'),
            ('HAYWOOD', 'U', 'CUDDLEME'),
            ('BEA', '', 'O\'PROBLEM'),
            ('URA', '', 'SNOTBALL'),
            ('HUGH', '', 'JASS'),
            ('OFFICER', '', 'BACON')]


def pick_birth_date():
    return random.randint(1950, 2000)


def pick_race():