"""Tests for exchange services.""" from apps.exchange.services import ExchangeConnectionService from apps.parsers.models import IndustrialCertificateRecord, ParserLoadLog from apps.registers.models import Organization from django.test import TestCase class ExchangeConnectionServiceDependenciesTest(TestCase): """Tests for dependency expansion in copy operation.""" def test_extend_models_without_registry_links(self): models_to_copy = ExchangeConnectionService._extend_models_with_dependencies( [ParserLoadLog] ) self.assertEqual(models_to_copy, [ParserLoadLog]) def test_extend_models_adds_registers_organization_first(self): models_to_copy = ExchangeConnectionService._extend_models_with_dependencies( [IndustrialCertificateRecord] ) self.assertEqual(models_to_copy[0], Organization) self.assertEqual(models_to_copy[1], IndustrialCertificateRecord)