printpub/tests/conftest.py

20 lines
424 B
Python
Raw Permalink Normal View History

2023-07-11 01:39:30 +00:00
import unittest.mock
import django.contrib.sites.models
import pytest
2023-07-11 01:39:30 +00:00
@pytest.fixture
def mock_domain():
fake_site = django.contrib.sites.models.Site(domain="my.website", name="My Website")
with unittest.mock.patch(
"django.contrib.sites.models.SiteManager.get_current",
return_value=fake_site,
):
yield
@pytest.fixture(autouse=True)
def enable_db_access_for_all_tests(db):
pass