"""
Notification Tests - Pytest Configuration.
"""
import pytest
from django.db import transaction

from apps.core.tenant.models import Tenant, Domain


@pytest.fixture(scope='function')
def tenant(db):
    """Create a test tenant with domain."""
    with transaction.atomic():
        tenant = Tenant.objects.create(
            name='Test Tenant',
            slug='test-tenant',
            schema_name='public',  # Use public schema for tests
        )
        Domain.objects.create(
            domain='localhost',
            tenant=tenant,
            is_primary=True,
        )
    return tenant
