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

b/snf-cyclades-app/synnefo/db/models_factory.py
53 53
    return lambda n: x[int(n) % size][0]
54 54

  
55 55

  
56
class FlavorFactory(factory.Factory):
56
class FlavorFactory(factory.DjangoModelFactory):
57 57
    FACTORY_FOR = models.Flavor
58 58

  
59 59
    cpu = factory.Sequence(lambda n: n + 2, type=int)
......
63 63
    deleted = False
64 64

  
65 65

  
66
class BackendFactory(factory.Factory):
66
class BackendFactory(factory.DjangoModelFactory):
67 67
    FACTORY_FOR = models.Backend
68 68

  
69 69
    clustername = factory.Sequence(prefix_seq('cluster'))
......
89 89
    offline = True
90 90

  
91 91

  
92
class VirtualMachineFactory(factory.Factory):
92
class VirtualMachineFactory(factory.DjangoModelFactory):
93 93
    FACTORY_FOR = models.VirtualMachine
94 94

  
95 95
    name = factory.Sequence(prefix_seq('vm'))
......
126 126
    operstate = "STOPED"
127 127

  
128 128

  
129
class VirtualMachineMetadataFactory(factory.Factory):
129
class VirtualMachineMetadataFactory(factory.DjangoModelFactory):
130 130
    FACTORY_FOR = models.VirtualMachineMetadata
131 131

  
132 132
    meta_key = factory.Sequence(prefix_seq('key'))
......
134 134
    vm = factory.SubFactory(VirtualMachineFactory)
135 135

  
136 136

  
137
class NetworkFactory(factory.Factory):
137
class NetworkFactory(factory.DjangoModelFactory):
138 138
    FACTORY_FOR = models.Network
139 139

  
140 140
    name = factory.Sequence(prefix_seq('network'))
......
158 158
    deleted = True
159 159

  
160 160

  
161
class BackendNetworkFactory(factory.Factory):
161
class BackendNetworkFactory(factory.DjangoModelFactory):
162 162
    FACTORY_FOR = models.BackendNetwork
163 163

  
164 164
    network = factory.SubFactory(NetworkFactory)
......
166 166
    operstate = factory.Sequence(round_seq_first(FACTORY_FOR.OPER_STATES))
167 167

  
168 168

  
169
class NetworkInterfaceFactory(factory.Factory):
169
class NetworkInterfaceFactory(factory.DjangoModelFactory):
170 170
    FACTORY_FOR = models.NetworkInterface
171 171

  
172 172
    machine = factory.SubFactory(VirtualMachineFactory)
......
181 181
        factory.Sequence(round_seq_first(FACTORY_FOR.FIREWALL_PROFILES))
182 182

  
183 183

  
184
class BridgePoolTableFactory(factory.Factory):
184
class BridgePoolTableFactory(factory.DjangoModelFactory):
185 185
    FACTORY_FOR = models.BridgePoolTable
186 186

  
187 187
    size = 20
188 188
    base = 'prv'
189 189

  
190 190

  
191
class MacPrefixPoolTableFactory(factory.Factory):
191
class MacPrefixPoolTableFactory(factory.DjangoModelFactory):
192 192
    FACTORY_FOR = models.MacPrefixPoolTable
193 193
    size = 100
194 194
    base = 'aa:00:0'
195 195

  
196 196

  
197
class QuotaHolderSerialFactory(factory.Factory):
197
class QuotaHolderSerialFactory(factory.DjangoModelFactory):
198 198
    FACTORY_FOR = models.QuotaHolderSerial

Also available in: Unified diff