forked from gergely/calendar-social
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.
This commit is contained in:
24
tests/test_calsocial.py
Normal file
24
tests/test_calsocial.py
Normal file
@@ -0,0 +1,24 @@
|
||||
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
|
Reference in New Issue
Block a user