def valid_resource2(valid_dataset2): resource = Resource() resource.url = "http://smth.smwhere.com" resource.title = "Resource name2" resource.resource_type = "Table" resource.dataset = valid_dataset2 resource.save() return resource
def resource_in_dataset_org2(dataset_org2): resource = Resource() resource.url = "http://tokill.shadowthieves.bg/cowled_wizards" resource.title = "Zakapturzeni czarodzieje" resource.resource_type = "Table" resource.dataset = dataset_org2 resource.save() return resource
def resource_without_dataset(valid_dataset): resource = Resource() resource.url = "http://smth.smwhere.com" resource.title = "Resource name" resource.is_external = True resource.resource_type = "Table" # resource.dataset = valid_dataset resource.save() return resource
def valid_resource2(valid_dataset2): resource = Resource() resource.link = "http://falconframework.org" resource.title = "Resource name2" resource.resource_type = "Table" resource.dataset = valid_dataset2 resource.tracker.saved_data['link'] = resource.link resource.tracker.saved_data['file'] = resource.file resource.save() return resource
def valid_resource(valid_dataset): resource = Resource() resource.link = "http://falconframework.org" resource.title = "Resource name" resource.resource_type = "Table" resource.dataset = valid_dataset resource.data_date = date.today() resource.tracker.saved_data['link'] = resource.link resource.save() return resource
def resource_without_dataset(valid_dataset): resource = Resource() resource.link = "http://falconframework.org" resource.title = "Resource name" resource.is_external = True resource.resource_type = "Table" # resource.dataset = valid_dataset resource.tracker.saved_data['link'] = resource.link resource.tracker.saved_data['file'] = resource.file resource.save() return resource
def valid_resource_with_file(valid_dataset, file_csv): resource = Resource() resource.title = "File resource name" resource.resource_type = "Table" resource.type = "file" resource.format = 'csv' resource.file = File(file_csv) resource.file.open('r') resource.dataset = valid_dataset resource.tracker.saved_data['link'] = resource.link resource.save() return resource
def test_resource_create(self, valid_dataset): r = Resource() # r.name = "test" r.title = "test" r.description = "Opis zasobu" r.format = "csv" r.resource_type = "zestawienie" r.old_resource_type = "zestawienie" r.dataset = valid_dataset r.link = "http://test.to.resource.pl/1.xls" r.data_date = "2018-10-02" assert r.full_clean() is None assert r.id is None r.save() assert r.id is not None