Changeset 861:f556a52ce160
- Timestamp:
- 03/10/10 16:45:08 (6 months ago)
- Author:
- johnbywater
- Branch:
- default
- Message:
-
Fixed license test fixtures.
- Location:
- ckan
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r857
|
r861
|
|
| 140 | 140 | _dict['%s - standard' % field] == 'Other (specify)' else \ |
| 141 | 141 | _dict['%s - standard' % field] |
| 142 | | #if 'HESA' in _dict['licence']: |
| 143 | | # license_title = u'OKD Compliant::Higher Education Statistics Agency Copyright with data.gov.uk rights' |
| 144 | | #else: |
| 145 | | # license_title = u'OKD Compliant::UK Crown Copyright with data.gov.uk rights' |
| | 142 | if 'HESA' in _dict['licence']: |
| | 143 | license_id = u'hesa-withrights' |
| | 144 | else: |
| | 145 | license_id = u'ukcrown-withrights' |
| 146 | 146 | |
| 147 | 147 | # extras |
| … |
… |
|
| 240 | 240 | pkg.add_resource(resource['url'], format=format, description=resource['description']) |
| 241 | 241 | pkg.notes=notes |
| 242 | | pkg.license_id = u'dsl' # Todo: Fix this. model.License.by_name(license_str) |
| | 242 | pkg.license_id = license_id |
| 243 | 243 | assert pkg.license |
| 244 | 244 | if not existing_pkg: |
-
|
r857
|
r861
|
|
| 123 | 123 | pkg.add_resource(res_url, description=res_description) |
| 124 | 124 | pkg.notes=notes |
| 125 | | pkg.license_id = u'dsl' # Todo: Fix this. |
| | 125 | pkg.license_id = u'ukcrown-withrights' |
| 126 | 126 | if not existing_pkg: |
| 127 | 127 | user = model.User.by_name(self._username) |
-
|
r857
|
r861
|
|
| 190 | 190 | self._item_count = 0 |
| 191 | 191 | self._new_package_count = 0 |
| 192 | | self._crown_license_id = u'dsl' # Todo: Fix this. |
| | 192 | self._crown_license_id = u'ukcrown-withrights' |
| 193 | 193 | |
| 194 | 194 | |
-
|
r857
|
r861
|
|
| 202 | 202 | pkg2.tags = [ tag1 ] |
| 203 | 203 | self.tag_names = [u'russian', u'tolstoy'] |
| 204 | | pkg1.license_id = u'agpl-v3' |
| | 204 | pkg1.license_id = u'other-open' |
| 205 | 205 | pkg2.title = u'A Wonderful Story' |
| 206 | 206 | genre_extra = model.PackageExtra(key=u'genre', value='romantic novel') |
| … |
… |
|
| 294 | 294 | 'tags':'images graphics photographs photos pictures us usa america history wildlife nature war military todo-split gov', |
| 295 | 295 | 'groups':'ukgov test1 penguin', |
| 296 | | 'license':'agpl-v3', |
| | 296 | 'license':'other-open', |
| 297 | 297 | 'notes':'''## About |
| 298 | 298 | |
| … |
… |
|
| 376 | 376 | 'author':'DCSF Data Services Group', |
| 377 | 377 | 'author_email':'statistics@dcsf.gsi.gov.uk', |
| 378 | | 'license':'dsl', |
| | 378 | 'license':'ukcrown', |
| 379 | 379 | 'tags':'children fostering', |
| 380 | 380 | 'extras':{ |
| … |
… |
|
| 403 | 403 | 'author':'DECC Energy Statistics Team', |
| 404 | 404 | 'author_email':'energy.stats@decc.gsi.gov.uk', |
| 405 | | 'license':'dsl', |
| | 405 | 'license':'ukcrown', |
| 406 | 406 | 'tags':'fuel prices', |
| 407 | 407 | 'extras':{ |
-
|
r856
|
r861
|
|
| 58 | 58 | (fs.maintainer, '', ''), |
| 59 | 59 | (fs.maintainer_email, '', ''), |
| 60 | | (fs.license_id, u'dsl'), # Todo: Fix this. |
| | 60 | (fs.license_id, u'ukcrown'), |
| 61 | 61 | ] |
| 62 | 62 | for vals in expected_values: |
-
|
r856
|
r861
|
|
| 121 | 121 | # assert '"license_id": 9' in res, res |
| 122 | 122 | assert 'license_id' not in res, res |
| 123 | | expected_license = '"license": "%s"' % 'agpl-v3' |
| 124 | | assert expected_license in res, repr(res) + repr(expected_license) |
| | 123 | assert '"license": "other-open"' in res, str(res) |
| 125 | 124 | assert 'russian' in res, res |
| 126 | 125 | assert 'tolstoy' in res, res |
| … |
… |
|
| 768 | 767 | assert anna_rec['name'] == 'annakarenina', res_dict['results'] |
| 769 | 768 | assert anna_rec['title'] == 'A Novel By Tolstoy', anna_rec['title'] |
| 770 | | assert anna_rec['license'] == u'agpl-v3', anna_rec['license'] |
| | 769 | assert anna_rec['license'] == u'other-open', anna_rec['license'] |
| 771 | 770 | assert len(anna_rec['tags']) == 2, anna_rec['tags'] |
| 772 | 771 | for expected_tag in ['russian', 'tolstoy']: |