[ckan-changes] [ckan/ckan] 9762a8: [#1894] Move test files to proper place

GitHub noreply at github.com
Mon Aug 25 13:32:37 UTC 2014


  Branch: refs/heads/1894-use-extras-and-convert_to_extras
  Home:   https://github.com/ckan/ckan
  Commit: 9762a858ab7c6a82b1e31432df4eb8f1d1a486e3
      https://github.com/ckan/ckan/commit/9762a858ab7c6a82b1e31432df4eb8f1d1a486e3
  Author: amercader <amercadero at gmail.com>
  Date:   2014-08-25 (Mon, 25 Aug 2014)

  Changed paths:
    R ckan/new_tests/lib/navl/test_converters.py
    A ckan/new_tests/logic/test_conversion.py
    M ckan/new_tests/logic/test_converters.py

  Log Message:
  -----------
  [#1894] Move test files to proper place

Moved functional tests to ckan/new_tests/logic/test_conversion.py and
added new unit tests for `convert_to_extras` to
ckan/new_tests/logic/test_converters.py


  Commit: 5161e15c08aae4032a5e596fff5d2deb1adfa703
      https://github.com/ckan/ckan/commit/5161e15c08aae4032a5e596fff5d2deb1adfa703
  Author: amercader <amercadero at gmail.com>
  Date:   2014-08-25 (Mon, 25 Aug 2014)

  Changed paths:
    M ckan/lib/navl/dictization_functions.py
    A ckan/new_tests/lib/navl/test_dictization_functions.py

  Log Message:
  -----------
  [#1894] Pass a list of keys in the schema to validators

This is included in the context. We pass a copy of the one provided to
validate.


  Commit: 8bf7e003a329586203d5628369f7c2371cd5b111
      https://github.com/ckan/ckan/commit/8bf7e003a329586203d5628369f7c2371cd5b111
  Author: amercader <amercadero at gmail.com>
  Date:   2014-08-25 (Mon, 25 Aug 2014)

  Changed paths:
    M ckan/logic/schema.py
    M ckan/logic/validators.py
    M ckan/new_tests/logic/test_conversion.py

  Log Message:
  -----------
  [#1894] Prevent free extras to have the same key as a schema field

Added a new validator to the 'key' field of the extras schema that
checks if the value is present on the 'schema_fields' list that was
added to the context on the previous commit.


  Commit: 500dc59de69206b20376a54bd9deff797b70bcd3
      https://github.com/ckan/ckan/commit/500dc59de69206b20376a54bd9deff797b70bcd3
  Author: amercader <amercadero at gmail.com>
  Date:   2014-08-25 (Mon, 25 Aug 2014)

  Changed paths:
    M ckan/logic/__init__.py

  Log Message:
  -----------
  [#1894] (Partially) Fix the error_summary for extras validation errors

If there is a validation error on the extras, the error summary would
*always* be `Missing Value`. I guess it was assumed that all validation
errors would be that the extra key was missing. The fix is not ideal, as
it still assumes that all errors will be on the 'key' field (there could
be custom validation on the value), but at least it will show more than
one error, and the ones different from `Missing Value`.

This can furhter be improved, eg changing the macro that renders the
error summary on the templates to allow lists of errors, and maybe
showing the error below the actual extra field (using the index?)


  Commit: 3158a75f547dc0e7a7b39fb95abc9d87d66ca4f5
      https://github.com/ckan/ckan/commit/3158a75f547dc0e7a7b39fb95abc9d87d66ca4f5
  Author: amercader <amercadero at gmail.com>
  Date:   2014-08-25 (Mon, 25 Aug 2014)

  Changed paths:
    M ckanext/example_idatasetform/templates/package/snippets/package_metadata_fields.html
    M doc/extensions/adding-custom-fields.rst

  Log Message:
  -----------
  [#1894] Update docs and example_idatasetform to reflect changes

I kept the example of removing the default key/value extras, as this is
what most people would want to do anyway, but mentioning that you have
the option of combining them both on CKAN >= 2.2.1


Compare: https://github.com/ckan/ckan/compare/6f8a0cadd784...3158a75f547d


More information about the ckan-changes mailing list