Exemplo n.º 1
0
def _reset_db():
    """_secret_ endpoint to cleanup and setup the database"""
    DB_URI = os.environ.get('DB_URI')
    setup_stores(DB_URI)
    users.reset()
    users.bootstrap()
    todo_lists.reset()
    todo_lists.bootstrap()
    return app.send_static_file('index.html')
Exemplo n.º 2
0
import nose.tools as nt

from webtest import TestApp

import checkit.server.api as api
from checkit.backend import setup_stores, users, todo_lists

########################
# Tests initialization #
########################

# Create and initialize the test database and the application
DB_URI = os.environ.get('TEST_DB_URI')
setup_stores(DB_URI)
users.bootstrap()
users.reset()
todo_lists.bootstrap()
todo_lists.reset()

app = TestApp(api.app)


# Load test data
data_file = codecs.open("./tests/test_data.json", "r", "utf-8").read()
data_file = json.loads(data_file)
user_data = data_file['user']
list_data = data_file['list']
item_data = data_file['item']

Exemplo n.º 3
0
import nose.tools as nt

from webtest import TestApp

import checkit.server.api as api
from checkit.backend import setup_stores, users, todo_lists

########################
# Tests initialization #
########################

# Create and initialize the test database and the application
DB_URI = os.environ.get('TEST_DB_URI')
setup_stores(DB_URI)
users.bootstrap()
users.reset()
todo_lists.bootstrap()
todo_lists.reset()

app = TestApp(api.app)

# Load test data
data_file = codecs.open("./tests/test_data.json", "r", "utf-8").read()
data_file = json.loads(data_file)
user_data = data_file['user']
list_data = data_file['list']
item_data = data_file['item']


########################