Added the first test case
This commit is contained in:
parent
1dd4e5eff3
commit
44139a4206
3
pytest.ini
Normal file
3
pytest.ini
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[pytest]
|
||||||
|
filterwarnings =
|
||||||
|
ignore:^Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working*:DeprecationWarning
|
1
requirements-dev.txt
Normal file
1
requirements-dev.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
pytest
|
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
|
Loading…
Reference in New Issue
Block a user