calendar-social/tests/test_calsocial.py
Gergely Polonkai 0595a28535 Add the first test
It just checks if the index page has a specific sentence.  But at least it’s now possible to
create tests.
2018-07-10 12:10:24 +02:00

25 lines
498 B
Python

import pytest
import calsocial
from calsocial.models import db
@pytest.fixture
def client():
calsocial.app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///'
calsocial.app.config['TESTING'] = True
client = calsocial.app.test_client()
with calsocial.app.app_context():
db.create_all()
yield client
def test_index_no_login(client):
"""Test the main page without logging in
"""
page = client.get('/')
assert b'Welcome to Calendar.social' in page.data