Skip to content

Commit

Permalink
Update homepage tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jdabtieu committed Jan 26, 2024
1 parent 14af2b6 commit df86012
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/tests/test_homepage.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json

Check warning on line 1 in src/tests/test_homepage.py

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

F401 'json' imported but unused

Check warning on line 1 in src/tests/test_homepage.py

View workflow job for this annotation

GitHub Actions / build (windows-latest)

F401 'json' imported but unused

from helpers import USER_PERM
from application import app # noqa


def test_homepage(client, database):
Expand Down Expand Up @@ -43,7 +44,13 @@ def test_homepage(client, database):
result = client.post('/admin/edithomepage', follow_redirects=True)
assert b'settings.py' in result.data

result = client.post('/admin/edithomepage', follow_redirects=True, data={"content": "some content"})
result = client.post('/admin/edithomepage', follow_redirects=True, data={"content": "some content", "method": "2"})
assert b'successfully' in result.data

client.get('/logout')

app.config["USE_HOMEPAGE"] = True
result = client.get('/')
assert result.status_code == 200
assert b"some content" in result.data
app.config["USE_HOMEPAGE"] = False

Check warning on line 56 in src/tests/test_homepage.py

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

W292 no newline at end of file

Check warning on line 56 in src/tests/test_homepage.py

View workflow job for this annotation

GitHub Actions / build (windows-latest)

W292 no newline at end of file

0 comments on commit df86012

Please sign in to comment.