Ejemplo n.º 1
0
def showcase_with_id_and_datasets(showcase_id, num):
    showcase = ShowcaseFactory.create(
        id=showcase_id, title='showcase {} with datasets'.format(showcase_id))
    datasets = DatasetFactory.create_batch(num, showcases=(showcase, ))
    for dataset in datasets:
        ResourceFactory.create_batch(3, dataset=dataset)
    return showcase
Ejemplo n.º 2
0
def datasets_with_resources_of_type(datasets_data):
    data = json.loads(datasets_data)
    for item in data:
        _dataset = DatasetFactory.create()
        for res_type, res_count in item.items():
            ResourceFactory.create_batch(res_count, dataset=_dataset, type=res_type)
    time.sleep(1)  # time to index data before request is made.
Ejemplo n.º 3
0
def application_with_id_and_datasets(application_id, num):
    application = ApplicationFactory.create(
        id=application_id,
        title='application {} with datasets'.format(application_id))
    datasets = DatasetFactory.create_batch(num, applications=(application, ))
    for dataset in datasets:
        ResourceFactory.create_batch(3, dataset=dataset)
    return application
Ejemplo n.º 4
0
def active_editor():
    usr = EditorFactory.create(email='*****@*****.**',
                               password='******',
                               phone='0048123456789')
    org = OrganizationFactory.create(users=(usr, ))
    ds = DatasetFactory.create(organization=org)
    ResourceFactory.create_batch(2, dataset=ds)
    return usr
Ejemplo n.º 5
0
def x_resources(num):
    return ResourceFactory.create_batch(num)
Ejemplo n.º 6
0
def resource_with_type(num, res_type):
    return ResourceFactory.create_batch(num, type=res_type)
Ejemplo n.º 7
0
def resources():
    return ResourceFactory.create_batch(3)
Ejemplo n.º 8
0
def dataset_with_resources():
    _dataset = DatasetFactory.create()
    ResourceFactory.create_batch(2, dataset=_dataset)
    return _dataset
Ejemplo n.º 9
0
def dataset_with_id_and_resources(dataset_id, slug):
    _dataset = DatasetFactory.create(id=dataset_id, slug=slug)
    ResourceFactory.create_batch(2, dataset=_dataset)
    return _dataset
Ejemplo n.º 10
0
def number_of_datasets_with_resources_with_type(number_of_datasets, num, res_type):
    for x in range(number_of_datasets):
        _dataset = DatasetFactory.create()
        ResourceFactory.create_batch(num, dataset=_dataset, type=res_type)
Ejemplo n.º 11
0
def dataset_with_title_and_x_resources(title, num):
    _dataset = DatasetFactory.create(title=title)
    ResourceFactory.create_batch(num, dataset=_dataset)
    return _dataset
Ejemplo n.º 12
0
def dataset_with_id_and_datasets(dataset_id, num):
    _dataset = DatasetFactory.create(id=dataset_id, title='dataset {} with resources'.format(dataset_id))
    ResourceFactory.create_batch(num, dataset=_dataset)
    return _dataset