Exemplo n.º 1
0
def license_options(existing_license_id=None):
    ckan_licenses_list = ckan_helpers.license_options()
    custom_licenses_list = [(u"CC-BY-4.0", u"Creative Commons Attribution 4.0")
                            ]  # Orden: 1) código - 2) título/nombre
    final_license_list = list(
        set.union(set(ckan_licenses_list), custom_licenses_list))
    final_license_list = map(
        lambda element: {
            "name": element[1],
            "code": element[0]
        }, final_license_list)
    return sorted(final_license_list, key=lambda x: x["name"])
Exemplo n.º 2
0
 def test_includes_existing_license(self):
     licenses = h.license_options("some-old-license")
     assert dict(licenses)["some-old-license"] == "some-old-license"
     # and it is first on the list
     assert licenses[0][0] == "some-old-license"
Exemplo n.º 3
0
 def test_includes_existing_license(self):
     licenses = h.license_options('some-old-license')
     eq_(dict(licenses)['some-old-license'], 'some-old-license')
     # and it is first on the list
     eq_(licenses[0][0], 'some-old-license')
Exemplo n.º 4
0
 def test_includes_existing_license(self):
     licenses = h.license_options('some-old-license')
     eq_(dict(licenses)['some-old-license'], 'some-old-license')
     # and it is first on the list
     eq_(licenses[0][0], 'some-old-license')