Added the first test case
This commit is contained in:
5
src/tests/__init__.py
Normal file
5
src/tests/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
import os
|
||||
os.environ['CAFF_PREVIEWER_ENDPOINT'] = ''
|
||||
os.environ['MINIO_ENDPOINT'] = ''
|
||||
os.environ['MINIO_ACCESS_KEY'] = ''
|
||||
os.environ['MINIO_SECRET_KEY'] = ''
|
||||
18
src/tests/test_access_allowed.py
Normal file
18
src/tests/test_access_allowed.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import pytest
|
||||
|
||||
import app
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client():
|
||||
app.app.config['TESTING'] = True
|
||||
|
||||
with app.app.test_client() as client:
|
||||
yield client
|
||||
|
||||
|
||||
def test_login_required(client):
|
||||
|
||||
r = client.get('/content/caff/1')
|
||||
|
||||
assert r.status_code == 302
|
||||
Reference in New Issue
Block a user