Add credits to account in test setup for content generation, linking, and optimization tests
- Updated test cases in `test_universal_content_types.py`, `test_universal_content_linking.py`, and `test_universal_content_optimization.py` to initialize account credits for testing. - Changed mock patch references to `run_ai_task` for consistency across tests.
This commit is contained in:
Binary file not shown.
@@ -14,9 +14,12 @@ class UniversalContentTypesTests(IntegrationTestBase):
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
# Add credits to account for testing
|
||||
self.account.credits = 10000
|
||||
self.account.save()
|
||||
self.service = ContentGenerationService()
|
||||
|
||||
@patch('igny8_core.business.content.services.content_generation_service.run_ai_task')
|
||||
@patch('igny8_core.ai.tasks.run_ai_task')
|
||||
def test_product_content_generates_correctly(self, mock_run_ai_task):
|
||||
"""
|
||||
Test: Product content generates correctly
|
||||
@@ -55,7 +58,7 @@ class UniversalContentTypesTests(IntegrationTestBase):
|
||||
self.assertEqual(call_args[1]['function_name'], 'generate_product_content')
|
||||
self.assertEqual(call_args[1]['payload']['product_name'], 'Test Product')
|
||||
|
||||
@patch('igny8_core.business.content.services.content_generation_service.run_ai_task')
|
||||
@patch('igny8_core.ai.tasks.run_ai_task')
|
||||
def test_service_pages_work_correctly(self, mock_run_ai_task):
|
||||
"""
|
||||
Test: Service pages work correctly
|
||||
@@ -94,7 +97,7 @@ class UniversalContentTypesTests(IntegrationTestBase):
|
||||
self.assertEqual(call_args[1]['function_name'], 'generate_service_page')
|
||||
self.assertEqual(call_args[1]['payload']['service_name'], 'Test Service')
|
||||
|
||||
@patch('igny8_core.business.content.services.content_generation_service.run_ai_task')
|
||||
@patch('igny8_core.ai.tasks.run_ai_task')
|
||||
def test_taxonomy_pages_work_correctly(self, mock_run_ai_task):
|
||||
"""
|
||||
Test: Taxonomy pages work correctly
|
||||
|
||||
@@ -14,6 +14,9 @@ class UniversalContentLinkingTests(IntegrationTestBase):
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
# Add credits to account for testing
|
||||
self.account.credits = 10000
|
||||
self.account.save()
|
||||
self.linker_service = LinkerService()
|
||||
|
||||
# Create product content
|
||||
|
||||
@@ -15,6 +15,9 @@ class UniversalContentOptimizationTests(IntegrationTestBase):
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
# Add credits to account for testing
|
||||
self.account.credits = 10000
|
||||
self.account.save()
|
||||
self.optimizer_service = OptimizerService()
|
||||
|
||||
# Create product content
|
||||
|
||||
Reference in New Issue
Block a user