def setUp(self): super().setUp() self.licence1, self.licence2 = LicenceFactory.create_batch(2) region_pl = RegionFactory(name='pl') self.licence3 = LicenceFactory(region=region_pl) self.base_object = BackOfficeAssetFactory() self.base_object2 = BackOfficeAssetFactory(region=region_pl) LicenceUser.objects.create(licence=self.licence1, user=self.user1) BaseObjectLicence.objects.create( licence=self.licence2, base_object=self.base_object )
def _init(self, num=10): self.licences = LicenceFactory.create_batch(num) for licence in self.licences: DataCenterAssetLicenceFactory.create_batch(3, licence=licence) BackOfficeAssetLicenceFactory.create_batch(2, licence=licence) LicenceUserFactory.create_batch(3, licence=licence)