backup for restore later

This commit is contained in:
IGNY8 VPS (Salman)
2025-11-16 03:28:25 +00:00
parent 60f5d876f0
commit dee2a36ff0
35 changed files with 8504 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
"""
Integration tests for System module endpoints
Tests settings, prompts, integrations return unified format
"""
from rest_framework import status
from igny8_core.api.tests.test_integration_base import IntegrationTestBase
class SystemIntegrationTestCase(IntegrationTestBase):
"""Integration tests for System module"""
def test_system_status_returns_unified_format(self):
"""Test GET /api/v1/system/status/ returns unified format"""
response = self.client.get('/api/v1/system/status/')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assert_unified_response_format(response, expected_success=True)
self.assertIn('data', response.data)
def test_list_prompts_returns_unified_format(self):
"""Test GET /api/v1/system/prompts/ returns unified format"""
response = self.client.get('/api/v1/system/prompts/')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assert_paginated_response(response)
def test_get_prompt_by_type_returns_unified_format(self):
"""Test GET /api/v1/system/prompts/by_type/{type}/ returns unified format"""
response = self.client.get('/api/v1/system/prompts/by_type/clustering/')
# May return 404 if no prompt exists, but should still be unified format
self.assertIn(response.status_code, [status.HTTP_200_OK, status.HTTP_404_NOT_FOUND])
self.assert_unified_response_format(response)
def test_list_account_settings_returns_unified_format(self):
"""Test GET /api/v1/system/settings/account/ returns unified format"""
response = self.client.get('/api/v1/system/settings/account/')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assert_paginated_response(response)
def test_get_integration_settings_returns_unified_format(self):
"""Test GET /api/v1/system/settings/integrations/{pk}/ returns unified format"""
response = self.client.get('/api/v1/system/settings/integrations/openai/')
# May return 404 if not configured, but should still be unified format
self.assertIn(response.status_code, [status.HTTP_200_OK, status.HTTP_404_NOT_FOUND])
self.assert_unified_response_format(response)