Revision f32e8021 snf-cyclades-app/synnefo/db/models_factory.py

b/snf-cyclades-app/synnefo/db/models_factory.py
109 109
    flavor = factory.SubFactory(FlavorFactory)
110 110
    deleted = False
111 111
    suspended = False
112
    operstate = factory.Sequence(round_seq_first(FACTORY_FOR.OPER_STATES))
112
    #operstate = factory.Sequence(round_seq_first(FACTORY_FOR.OPER_STATES))
113
    operstate = "STARTED"
113 114

  
114 115

  
115 116
class DeletedVirtualMachine(VirtualMachineFactory):
......
168 169
class BackendNetworkFactory(factory.DjangoModelFactory):
169 170
    FACTORY_FOR = models.BackendNetwork
170 171

  
171
    network = factory.SubFactory(NetworkFactory)
172
    network = factory.SubFactory(NetworkFactory, state="ACTIVE")
172 173
    backend = factory.SubFactory(BackendFactory)
173 174
    operstate = factory.Sequence(round_seq_first(FACTORY_FOR.OPER_STATES))
174 175

  
......
177 178
    FACTORY_FOR = models.NetworkInterface
178 179

  
179 180
    name = factory.LazyAttribute(lambda self: random_string(30))
180
    machine = factory.SubFactory(VirtualMachineFactory)
181
    network = factory.SubFactory(NetworkFactory)
181
    machine = factory.SubFactory(VirtualMachineFactory, operstate="STARTED")
182
    network = factory.SubFactory(NetworkFactory, state="ACTIVE")
182 183
    index = factory.Sequence(lambda x: x, type=int)
183 184
    mac = factory.Sequence(lambda n: 'aa:{0}{0}:{0}{0}:aa:{0}{0}:{0}{0}'
184 185
                           .format(hex(int(n) % 15)[2:3]))
......
223 224
class IPv4AddressFactory(factory.DjangoModelFactory):
224 225
    FACTORY_FOR = models.IPAddress
225 226

  
226
    network = factory.SubFactory(NetworkFactory)
227
    network = factory.SubFactory(NetworkFactory, state="ACTIVE")
227 228
    subnet = factory.SubFactory(IPv4SubnetFactory,
228 229
                                network=factory.SelfAttribute('..network'))
229 230
    address =\
......
237 238
    FACTORY_FOR = models.IPAddress
238 239

  
239 240
    subnet = factory.SubFactory(IPv6SubnetFactory)
240
    network = factory.SubFactory(NetworkFactory)
241
    network = factory.SubFactory(NetworkFactory, state="ACTIVE")
241 242
    address = "babe::"
242 243
    nic = factory.SubFactory(NetworkInterfaceFactory,
243 244
                             network=factory.SelfAttribute('..network'))
......
245 246

  
246 247
class FloatingIPFactory(IPv4AddressFactory):
247 248
    network = factory.SubFactory(NetworkFactory, public=True,
248
                                 floating_ip_pool=True)
249
                                 floating_ip_pool=True, state="ACTIVE")
249 250
    floating_ip = True
250 251

  
251 252

  

Also available in: Unified diff