<commit_before>from django.utils.functional import cached_property

from nodeconductor.structure import models as structure_models
from nodeconductor.structure.tests import factories as structure_factories
from nodeconductor.structure.tests.fixtures import ProjectFixture
from nodeconductor_openstack.openstack import models as openstack_models, apps as openstack_apps

from . import factories


class OpenStackFixture(ProjectFixture):
    @cached_property
    def openstack_service_settings(self):
        # OpenStack packages should be used only with shared settings.
        return structure_factories.ServiceSettingsFactory(
            type=openstack_apps.OpenStackConfig.service_name,
            shared=True,
            options={'external_network_id': 'test_network_id'},
            state=structure_models.ServiceSettings.States.OK,
        )

    @cached_property
    def openstack_service(self):
        return openstack_models.OpenStackService.objects.create(
            customer=self.customer,
            settings=self.openstack_service_settings,
            name=self.openstack_service_settings.name
        )

    @cached_property<commit_msg>Remove service name from fixtures [WAL-496]<commit_after>from django.utils.functional import cached_property

from nodeconductor.structure import models as structure_models
from nodeconductor.structure.tests import factories as structure_factories
from nodeconductor.structure.tests.fixtures import ProjectFixture
from nodeconductor_openstack.openstack import models as openstack_models, apps as openstack_apps

from . import factories


class OpenStackFixture(ProjectFixture):
    @cached_property
    def openstack_service_settings(self):
        # OpenStack packages should be used only with shared settings.
        return structure_factories.ServiceSettingsFactory(
            type=openstack_apps.OpenStackConfig.service_name,
            shared=True,
            options={'external_network_id': 'test_network_id'},
            state=structure_models.ServiceSettings.States.OK,
        )

    @cached_property
    def openstack_service(self):
        return openstack_models.OpenStackService.objects.create(
            customer=self.customer,
            settings=self.openstack_service_settings,
        )

    @cached_property
{'fraction_non_alphanumeric': 0.05666957279860506, 'fraction_numerical': 0.0013077593722755014, 'mean_word_length': 3.882978723404255, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '530353', 'n_tokens_mistral': 589, 'n_tokens_neox': 559, 'n_words': 127}