"""
Test script to verify URL patterns are correctly registered
Run this with: python manage.py shell < test_urls.py
"""
from django.urls import resolve, reverse
from django.test import RequestFactory

# Test URL resolution
try:
    # Test the generate endpoint
    url_path = '/api/v1/system/settings/integrations/image_generation/generate/'
    resolved = resolve(url_path)
    print(f"✅ URL resolved: {url_path}")
    print(f"   View: {resolved.func}")
    print(f"   Args: {resolved.args}")
    print(f"   Kwargs: {resolved.kwargs}")
except Exception as e:
    print(f"❌ URL NOT resolved: {url_path}")
    print(f"   Error: {e}")

# Test reverse
try:
    reversed_url = reverse('integration-settings-generate', kwargs={'pk': 'image_generation'})
    print(f"✅ Reverse URL: {reversed_url}")
except Exception as e:
    print(f"❌ Reverse failed: {e}")

