Ejemplo n.º 1
0
def removed_resource(valid_dataset2):
    resource = Resource()
    resource.link = "http://noth.nowhere.com"
    resource.title = "removed resource"
    resource.dataset = valid_dataset2
    resource.is_removed = True
    resource.save()
    return resource
Ejemplo n.º 2
0
def draft_resource(valid_dataset2):
    resource = Resource()
    resource.link = "http://drafts.com"
    resource.title = "draft resource"
    resource.dataset = valid_dataset2
    resource.status = "draft"
    resource.save()
    return resource
Ejemplo n.º 3
0
def resource_in_dataset_org2(dataset_org2):
    resource = Resource()
    resource.link = "http://tokill.shadowthieves.bg/cowled_wizards"
    resource.title = "Zakapturzeni czarodzieje"
    resource.resource_type = "Table"
    resource.dataset = dataset_org2
    resource.save()
    return resource
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
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
Ejemplo n.º 6
0
def valid_resource_with_description(valid_dataset):
    resource = Resource()
    resource.link = "http://falconframework.org"
    resource.title = "Resource name"
    resource.description = "Test Resource Description"
    resource.dataset = valid_dataset
    resource.status = 'published'
    resource.tracker.saved_data['link'] = resource.link
    resource.tracker.saved_data['file'] = resource.file
    resource.save()
    return resource
Ejemplo n.º 7
0
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
Ejemplo n.º 8
0
 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