[ckan-changes] [okfn/ckan] 4d69df: [#718] Use error codes instead of relying on engli...

GitHub noreply at github.com
Mon Apr 15 14:37:38 UTC 2013


  Branch: refs/heads/release-v2.0
  Home:   https://github.com/okfn/ckan
  Commit: 4d69dfea9cd44bd573e887f5d18f892c0da8c3b1
      https://github.com/okfn/ckan/commit/4d69dfea9cd44bd573e887f5d18f892c0da8c3b1
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2013-03-28 (Thu, 28 Mar 2013)

  Changed paths:
    M ckanext/datastore/db.py
    M ckanext/datastore/plugin.py

  Log Message:
  -----------
  [#718] Use error codes instead of relying on english error messages in datastore


  Commit: 52f5e78ee55b2f54ded61c97257968321c7814f2
      https://github.com/okfn/ckan/commit/52f5e78ee55b2f54ded61c97257968321c7814f2
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2013-03-28 (Thu, 28 Mar 2013)

  Changed paths:
    M ckanext/datastore/plugin.py

  Log Message:
  -----------
  [#642] Add spaces to log messages where they are missing


  Commit: 3824eb23ccc1f92879c3b75002dd9afa939ecce1
      https://github.com/okfn/ckan/commit/3824eb23ccc1f92879c3b75002dd9afa939ecce1
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2013-03-28 (Thu, 28 Mar 2013)

  Changed paths:
    M ckanext/datastore/plugin.py

  Log Message:
  -----------
  [#642] Use has_table_privilege and has_schema_privilege instead of experimental privilege checks.

Conflicts:
	ckanext/datastore/plugin.py


  Commit: 306f016d1b1803302c0c9b9999fad3b6e14ba92b
      https://github.com/okfn/ckan/commit/306f016d1b1803302c0c9b9999fad3b6e14ba92b
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2013-03-28 (Thu, 28 Mar 2013)

  Changed paths:
    M ckanext/datastore/plugin.py

  Log Message:
  -----------
  [#642] Make check functions consistent (return bool instead of raising exceptions)


  Commit: 244bc6628f7474549409bb6093f345b5494025f6
      https://github.com/okfn/ckan/commit/244bc6628f7474549409bb6093f345b5494025f6
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2013-03-28 (Thu, 28 Mar 2013)

  Changed paths:
    M ckanext/datastore/plugin.py
    M ckanext/datastore/tests/test_configure.py

  Log Message:
  -----------
  [#642] Refactor datastore plugin configuration, improve (and fix ;-)) tests


  Commit: 6717440f2efb380e9a1749ca5679ec9eae0e1e06
      https://github.com/okfn/ckan/commit/6717440f2efb380e9a1749ca5679ec9eae0e1e06
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2013-03-28 (Thu, 28 Mar 2013)

  Changed paths:
    M ckanext/datastore/plugin.py
    M ckanext/datastore/tests/test_configure.py

  Log Message:
  -----------
  [#642] Fix how the check for separate urls is ignored in legacy mode.
I put the check for the legacy mode in this function to make it testable.


  Commit: 2ceae033001f6376cac760c999c1ebafce22ac96
      https://github.com/okfn/ckan/commit/2ceae033001f6376cac760c999c1ebafce22ac96
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2013-03-28 (Thu, 28 Mar 2013)

  Changed paths:
    M ckanext/datastore/plugin.py

  Log Message:
  -----------
  [#642] Simplify check for debug mode, only create _foo once


  Commit: f947fbb8b08776a8c023d1be9a21d71db8f2d20d
      https://github.com/okfn/ckan/commit/f947fbb8b08776a8c023d1be9a21d71db8f2d20d
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2013-03-28 (Thu, 28 Mar 2013)

  Changed paths:
    M ckanext/datastore/db.py

  Log Message:
  -----------
  [#718] Move pg error codes in a separate dictionary


  Commit: 98d1a06245ec1d2e3f9c2e65fc8938c1363d58d3
      https://github.com/okfn/ckan/commit/98d1a06245ec1d2e3f9c2e65fc8938c1363d58d3
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2013-03-28 (Thu, 28 Mar 2013)

  Changed paths:
    M ckanext/datastore/db.py
    M ckanext/datastore/plugin.py

  Log Message:
  -----------
  [#718] Try to avoid PL/pgSQL since we cannot guarantee that is is activated


  Commit: a97bb5f1f65db4708c1d03f1b5a8c54a25bd96ff
      https://github.com/okfn/ckan/commit/a97bb5f1f65db4708c1d03f1b5a8c54a25bd96ff
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2013-03-28 (Thu, 28 Mar 2013)

  Changed paths:
    M ckanext/datastore/plugin.py
    M ckanext/datastore/tests/test_configure.py

  Log Message:
  -----------
  [#642] Refactored datastore config to make it easier to understand and easier to test


  Commit: 38ea5c6572de8c6b923025b8157816dfba92941f
      https://github.com/okfn/ckan/commit/38ea5c6572de8c6b923025b8157816dfba92941f
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2013-03-29 (Fri, 29 Mar 2013)

  Changed paths:
    M ckanext/datastore/plugin.py
    M ckanext/datastore/tests/test_configure.py

  Log Message:
  -----------
  [#642] Ignore permission check in legacy mode and improve configuration tests


  Commit: a4d88b756c90c794f7f3473b319d386182d74ce8
      https://github.com/okfn/ckan/commit/a4d88b756c90c794f7f3473b319d386182d74ce8
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2013-04-03 (Wed, 03 Apr 2013)

  Changed paths:
    M ckanext/datastore/plugin.py
    M ckanext/datastore/tests/test_configure.py

  Log Message:
  -----------
  [#642] Inject `error_handler` instead of explicitly passing it as an argument, split large test into smaller tests


  Commit: d76c6570fe96e64925ff7d847e5a0e561ea5be55
      https://github.com/okfn/ckan/commit/d76c6570fe96e64925ff7d847e5a0e561ea5be55
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2013-04-03 (Wed, 03 Apr 2013)

  Changed paths:
    M ckanext/datastore/tests/test_configure.py

  Log Message:
  -----------
  [#642] Add plugin loading and unloading. This does not fix the singleton issue but is better anyway.


  Commit: 705c39e45ced0ab79567df357f891ad76753a5a8
      https://github.com/okfn/ckan/commit/705c39e45ced0ab79567df357f891ad76753a5a8
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2013-04-03 (Wed, 03 Apr 2013)

  Changed paths:
    M ckanext/datastore/db.py
    M ckanext/datastore/plugin.py

  Log Message:
  -----------
  [#642] Use single quotes where possible


  Commit: 3c60da1e540a1258f1c54b1c43f6c221e0edbf6f
      https://github.com/okfn/ckan/commit/3c60da1e540a1258f1c54b1c43f6c221e0edbf6f
  Author: Vitor Baptista <vitor at vitorbaptista.com>
  Date:   2013-04-03 (Wed, 03 Apr 2013)

  Changed paths:
    M ckanext/datastore/tests/test_configure.py

  Log Message:
  -----------
  [#642] Refactor and fix Datastore tests

Datastore is a SingletonPlugin, so it doesn't matter if we call
plugin.DatastorePlugin() many times: we always end up with the same instance.
I've added a workaround that, first, saves and unloads the current datastore
instance, then sets:

  pyutilib.component.core.PluginGlobals.singleton_services()[plugin.DatastorePlugin] = True

This will make plugin.DatastorePlugin not be a Singleton anymore, so any
subsequent calls to ckan.plugins.load('datastore') will create a new instance.
Then, in the next line, we create a new DatastorePlugin instance by loading
it, and save it into self.p and
pyutilib.component.core.PluginGlobals.singleton_services()[plugin.DatastorePlugin].
This turns DatastorePlugin into a Singleton again, and subsequent calls to
ckan.plugins.load('datastore') will return this new instance instead.

Then, in the teardown, we unload the current the datastore, which gets rid of
our test instance, and put the original datastore back in its place, so the
environment before setUp() is the same as after tearDown().

For InvalidUrlsOrPermissionsException, what I wanted was a way to check if
_check_urls_and_permissions() failed. I did this by overloading _log_or_raise()
with an unique Exception, and checking if it's raised. If so, I guarantee that
_log_or_raise() was called. This feels like too much boilerplate, but we don't
have a stub/mock library, so we have to write it.

Conflicts:
	ckanext/datastore/tests/test_configure.py


  Commit: 09b23ddeb60b25aaed97f538c23e411b11292b30
      https://github.com/okfn/ckan/commit/09b23ddeb60b25aaed97f538c23e411b11292b30
  Author: Dominik Moritz <domoritz at gmail.com>
  Date:   2013-04-03 (Wed, 03 Apr 2013)

  Changed paths:
    M ckanext/datastore/tests/test_configure.py

  Log Message:
  -----------
  [#642] PEP8


  Commit: 6f8f706d572c71d1bed7a468ada3cbfda5d2daa0
      https://github.com/okfn/ckan/commit/6f8f706d572c71d1bed7a468ada3cbfda5d2daa0
  Author: amercader <amercadero at gmail.com>
  Date:   2013-04-15 (Mon, 15 Apr 2013)

  Changed paths:
    M ckanext/datastore/db.py

  Log Message:
  -----------
  Merge branch '718-datastore-depends-on-localisation-for-2.0' into release-v2.0


Compare: https://github.com/okfn/ckan/compare/0e1fdbfa0eab...6f8f706d572c


More information about the ckan-changes mailing list