Skip to content

Commit

Permalink
fix tests'
Browse files Browse the repository at this point in the history
  • Loading branch information
dwreeves committed May 26, 2024
1 parent 9ef66f5 commit 9310c63
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ class TestingConfig(Config):
"""

ENV: str = "testing"
PREFERRED_URL_SCHEME: str = "https"
SEND_TWEETS: bool = True # Won't actually send tweets.
TESTING: bool = True
CACHE_TYPE: str = "flask_caching.backends.simple"
Expand All @@ -269,6 +270,8 @@ class TestingConfig(Config):
POSTGRES_DB: str = os.getenv("POSTGRES_DB", "flagging") + "_test"
MAIL_USERNAME = "[email protected]"
MAIL_ERROR_ALERTS_TO = "[email protected]"
BASIC_AUTH_USERNAME: str = "admin"
BASIC_AUTH_PASSWORD: str = "password"


class DemoConfig(ProductionConfig):
Expand Down
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest
from flask import g
from flask.testing import FlaskClient
from pytest_postgresql.janitor import DatabaseJanitor

from app.data.database import init_db
Expand Down Expand Up @@ -46,7 +47,7 @@ def live_app(app):


@pytest.fixture(scope="function")
def client(app):
def client(app) -> FlaskClient:
"""A test client for the app. You can think of the test like a web browser;
it retrieves data from the website in a similar way that a browser would.
"""
Expand Down
1 change: 0 additions & 1 deletion tests/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def test_pages(client, page, expected_status_code):
def test_admin_pages(client, page, auth, expected_status_code):
headers = auth_to_header(auth)
res = client.get(page, headers=headers)

assert res.status_code == expected_status_code


Expand Down

0 comments on commit 9310c63

Please sign in to comment.