# Path: planb/factories.py
# class FilesetFactory(DjangoModelFactory):
#     host_prefix = factory.Faker('hostname', levels=0)
#     host_suffix = factory.Faker('domain_word')
#     tld = factory.Faker('tld')
# 
#     @factory.lazy_attribute
#     def friendly_name(self):
#         # Set friendly name as the full hostname within the hostgroup domain.
#         return '.'.join((
#             self.host_prefix, self.host_suffix, self.hostgroup.name, self.tld))
# 
#     storage_alias = 'dummy'
#     hostgroup = factory.SubFactory(HostGroupFactory)
# 
#     class Meta:
#         model = 'planb.Fileset'
#         exclude = ['host_prefix', 'host_suffix', 'tld']


import factory
from factory.django import DjangoModelFactory
from planb.factories import FilesetFactory



class RsyncConfigFactory(DjangoModelFactory):
    fileset = factory.SubFactory(FilesetFactory)
    host = factory.SelfAttribute('fileset.friendly_name')

    transport = 0  # SSH


# Path: planb/factories.py
# class FilesetFactory(DjangoModelFactory):
#     host_prefix = factory.Faker('hostname', levels=0)
#     host_suffix = factory.Faker('domain_word')
#     tld = factory.Faker('tld')
# 
#     @factory.lazy_attribute
#     def friendly_name(self):
#         # Set friendly name as the full hostname within the hostgroup domain.
#         return '.'.join((
#             self.host_prefix, self.host_suffix, self.hostgroup.name, self.tld))
# 
#     storage_alias = 'dummy'
#     hostgroup = factory.SubFactory(HostGroupFactory)
# 
#     class Meta:
#         model = 'planb.Fileset'
#         exclude = ['host_prefix', 'host_suffix', 'tld']


# Path: planb/transport_rsync/factories.py
import factory
from factory.django import DjangoModelFactory
from planb.factories import FilesetFactory




class RsyncConfigFactory(DjangoModelFactory):
    fileset = factory.SubFactory(FilesetFactory)
    host = factory.SelfAttribute('fileset.friendly_name')

    transport = 0  # SSH


    class Meta: