Create the Profile.follow() method

This commit is contained in:
2018-07-11 16:40:42 +02:00
parent 37e08fed22
commit 27c78ff36f
3 changed files with 96 additions and 3 deletions

View File

@@ -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()