quantum-ai-v3/tests/simple_test.py
Claude bfdef5b658 Refactor: Complete architecture reorganization with proper separation of concerns
BREAKING CHANGES:
- Move marketplace and agent discovery views from core to agent_base app
- Transfer all wallet functionality from core to dedicated wallet app
- Move Stripe webhook handling to wallet app for better organization
- Consolidate payment system logic under single responsibility

NEW STRUCTURE:
- core app: Platform pages only (homepage, pricing)
- agent_base app: Complete agent marketplace and catalog system
- wallet app: Full payment system with Stripe integration
- Individual agent apps: Unchanged, self-contained

IMPROVEMENTS:
- Clean URL namespacing (agent_base:marketplace, wallet:wallet)
- Template organization by app responsibility
- Removed deprecated CSS files (header.css)
- Added utility classes (.hidden)
- Updated all template references to new URL structure
- Comprehensive CLAUDE.md documentation updates

TECHNICAL CHANGES:
- Templates moved: marketplace.html, agent_detail.html → agent_base/
- Templates moved: wallet*.html → wallet/
- New files: agent_base/views.py, agent_base/urls.py, wallet/urls.py
- Updated main urls.py routing configuration
- Fixed Django system checks and namespace conflicts
- Verified all functionality with test suite

This reorganization follows Django best practices with single responsibility
principle, making the codebase more maintainable and scalable.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 20:03:53 +05:30

85 lines
2.6 KiB
Python

#!/usr/bin/env python
import os
import sys
import django
# Add the project root to Python path
sys.path.insert(0, '/home/amit/Desktop/quantum_ai')
# Set Django settings
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'netcop_hub.settings')
django.setup()
from agent_base.models import BaseAgent
from core.views import homepage_view
from django.http import HttpRequest
from django.contrib.auth.models import AnonymousUser
def test_agent_visibility():
print("🧪 Testing Agent System Integration")
print("=" * 40)
# Check agents in database
agents = BaseAgent.objects.filter(is_active=True)
print(f"✅ Active agents in database: {agents.count()}")
for agent in agents:
print(f" 📋 {agent.name} ({agent.slug})")
print(f" Category: {agent.category}")
print(f" Price: {agent.price} AED")
print(f" Type: {agent.agent_type}")
print()
# Test the homepage view directly
print("🧪 Testing Homepage View")
print("-" * 20)
request = HttpRequest()
request.method = 'GET'
request.user = AnonymousUser()
request.META = {'HTTP_HOST': 'testserver'}
try:
response = homepage_view(request)
print(f"✅ Homepage view response status: {response.status_code}")
# Check if the response contains weather agent
if hasattr(response, 'content'):
content = response.content.decode('utf-8')
if 'Weather Reporter' in content:
print("✅ Weather Reporter found in homepage HTML")
else:
print("❌ Weather Reporter not found in homepage HTML")
if 'Use Now' in content:
print("'Use Now' buttons found")
else:
print("'Use Now' buttons not found")
except Exception as e:
print(f"❌ Error in homepage view: {e}")
def check_url_structure():
print("\n🧪 Checking URL Structure")
print("=" * 40)
from django.urls import reverse
try:
# Test core URLs
homepage_url = reverse('core:homepage')
print(f"✅ Homepage URL: {homepage_url}")
marketplace_url = reverse('agent_base:marketplace')
print(f"✅ Marketplace URL: {marketplace_url}")
# Test weather reporter URL
weather_url = reverse('weather_reporter:detail')
print(f"✅ Weather Reporter URL: {weather_url}")
except Exception as e:
print(f"❌ URL resolution error: {e}")
if __name__ == '__main__':
test_agent_visibility()
check_url_structure()