You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
581 B
Python
36 lines
581 B
Python
import pytest
|
|
|
|
from htmx_contact import create_app
|
|
from htmx_contact.config import ContactSettings
|
|
|
|
|
|
@pytest.fixture()
|
|
def test_config():
|
|
return ContactSettings(SECRET_KEY=b"secrettestingvalue")
|
|
|
|
|
|
@pytest.fixture()
|
|
def app(test_config):
|
|
app = create_app(config=test_config)
|
|
app.config.update(
|
|
{
|
|
"TESTING": True,
|
|
}
|
|
)
|
|
|
|
# other setup can go here
|
|
|
|
yield app
|
|
|
|
# clean up / reset resources here
|
|
|
|
|
|
@pytest.fixture()
|
|
def client(app):
|
|
return app.test_client()
|
|
|
|
|
|
@pytest.fixture()
|
|
def runner(app):
|
|
return app.test_cli_runner()
|