示例#1
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
示例#2
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