

def generate_licence(self):
    self.stdout.write('Generating Licences')
    for i in range(self.object_limit):
        licence = LicenceFactory()
        LicenceUser.objects.create(licence=licence, user=self.get_user())
        for j in range(3):
            back_office_asset = BaseObjectLicenceFactory(licence=licence).base_object
            back_office_asset.owner = self.get_user()
            back_office_asset.user = self.get_user()
            back_office_asset.save()
        licence = LicenceFactory()
        LicenceUser.objects.create(licence=licence, user=self.get_user())
        for j in range(3):
            DataCenterAssetLicenceFactory(licence=licence)

dataset/ETHPy150Open allegro/ralph/src/ralph/data_importer/management/commands/demodata.py Command.generate_licence/original