forked from gergely/calendar-social
Create the Profile.follow() method
This commit is contained in:
@@ -23,14 +23,20 @@ import calsocial
|
||||
from calsocial.models import db
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client():
|
||||
"""Fixture that provides a Flask test client
|
||||
def configure_app():
|
||||
"""Set default configuration values for testing
|
||||
"""
|
||||
|
||||
calsocial.app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///'
|
||||
calsocial.app.config['TESTING'] = True
|
||||
calsocial.app.config['WTF_CSRF_ENABLED'] = False
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client():
|
||||
"""Fixture that provides a Flask test client
|
||||
"""
|
||||
configure_app()
|
||||
client = calsocial.app.test_client()
|
||||
|
||||
with calsocial.app.app_context():
|
||||
@@ -49,3 +55,18 @@ def login(client, username, password, no_redirect=False):
|
||||
return client.post('/login',
|
||||
data={'email': username, 'password': password},
|
||||
follow_redirects=not no_redirect)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def database():
|
||||
"""Fixture to provide all database tables in an active application context
|
||||
"""
|
||||
|
||||
configure_app()
|
||||
|
||||
with calsocial.app.app_context():
|
||||
db.create_all()
|
||||
|
||||
yield db
|
||||
|
||||
db.drop_all()
|
||||
|
Reference in New Issue
Block a user