Skip to content

Commit a0e95cd

Browse files
authored
Merge pull request #2 from Jbguerin13/test-show_summary
feat: test show summary
2 parents b871f6c + 7b2b22d commit a0e95cd

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

pytest.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[pytest]
2+
filterwarnings =
3+
ignore::DeprecationWarning

tests/test_show_summary.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import pytest
2+
3+
def test_welcome_page_when_loading_accepted(client, setup_data):
4+
"""TEST: The welcome page should load when credentials are correct"""
5+
response = client.post('/show_summary', data={'email': 'clubA@example.com'})
6+
7+
assert response.status_code == 200
8+
assert b"Welcome" in response.data
9+
assert b"Competition 1" in response.data
10+
11+
def test_error_when_wrong_credentials(client, setup_data):
12+
"""TEST: Wrong credentials should redirect to index with an error message"""
13+
response = client.post('/show_summary', data={'email': 'fake@example.com'}, follow_redirects=True)
14+
15+
assert response.status_code == 200
16+
assert b"Wrong credentials, please retry" in response.data

0 commit comments

Comments
 (0)