[ckan-changes] [okfn/ckan] e4d4d2: Refactor dashboard activity stream tests

GitHub noreply at github.com
Wed Nov 21 22:37:21 UTC 2012


  Branch: refs/heads/refactor-dashboard-tests
  Home:   https://github.com/okfn/ckan
  Commit: e4d4d28912b5eefb2fb35e3bb714a42f9a94f119
      https://github.com/okfn/ckan/commit/e4d4d28912b5eefb2fb35e3bb714a42f9a94f119
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-21 (Wed, 21 Nov 2012)

  Changed paths:
    M ckan/tests/functional/api/test_activity.py
    M ckan/tests/functional/api/test_dashboard.py
    M ckan/tests/functional/api/test_follow.py

  Log Message:
  -----------
  Refactor dashboard activity stream tests

- Move tests for contents of dashboard activity stream out of test_activity.py,
this test module was way too long and confusing, leave it for testing the
public activity streams only. Add a docstring to the module saying so.

- Add a docstring to test_follow.py explaining that it tests the follower
functions only (follow, unfollow, etc.) and not the contents of the dashboard
activity stream that is generated from what you're folllowing.

- Add new tests for the contents of the dashboard activity stream in
test_dashboard.py along with other dashboard tests.

Currently some of these tests are failing because activities from followed
groups are not appearing in the dashboard.


  Commit: a3b8b16a0516e947a5774cbea279b11db10e7d8d
      https://github.com/okfn/ckan/commit/a3b8b16a0516e947a5774cbea279b11db10e7d8d
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-21 (Wed, 21 Nov 2012)

  Changed paths:
    M ckan/model/activity.py

  Log Message:
  -----------
  Add activities from followed groups to dashboard activity stream

Add activities from groups that a user is following (e.g. when someone
updates a group) to the user's dashboard activity stream.

There are still some test_dashboard.py tests failing because activities
from datasets belonging to followed groups dob't appear in the dashboard
yet.


  Commit: aa36db4c2384764fd1b2f7cbdd7f666dcd116911
      https://github.com/okfn/ckan/commit/aa36db4c2384764fd1b2f7cbdd7f666dcd116911
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-21 (Wed, 21 Nov 2012)

  Changed paths:
    M ckan/logic/action/get.py
    M ckan/model/group.py

  Log Message:
  -----------
  Move group_package_show SQLAlchemy into model

Move the SQLAlchemy query that the group_package_show() action function
uses into the model. I need this for architectural reasons for upcoming
commits, and we're supposed to encapsulate SQLAlchemy in the model
anyway.

I made the new model function support the 'return_query' option but note
that there are no tests covering this, all the tests pass even without
this option.


  Commit: 24184241244bd27e3d3bbb734e368c022d9bdfa4
      https://github.com/okfn/ckan/commit/24184241244bd27e3d3bbb734e368c022d9bdfa4
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-21 (Wed, 21 Nov 2012)

  Changed paths:
    M ckan/model/group.py

  Log Message:
  -----------
  Remove group.members_of_type()

Remove group.members_of_type() and related code. It isn't used anywhere
except in the old publisher and organizations extensions which are to be
replaced by a new organizations implementation in CKAN core. Also it
duplicates functionality provided by group.active_packages().


  Commit: 83d2ef7bc43da4ec671016b5cb8429bb7f006d9d
      https://github.com/okfn/ckan/commit/83d2ef7bc43da4ec671016b5cb8429bb7f006d9d
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-21 (Wed, 21 Nov 2012)

  Changed paths:
    M ckan/controllers/group.py
    M ckan/lib/dictization/model_dictize.py
    M ckan/logic/action/get.py
    M ckan/model/group.py
    M ckan/tests/functional/test_group.py
    M ckan/tests/lib/test_dictization_schema.py
    M ckan/tests/models/test_group.py

  Log Message:
  -----------
  Remove duplicate methods to get a group's packages

Refactor active_packages() and get_package_revisions(), both of which
return a group's packages (but in slightly different ways), replace with
just one method packages().

We now have just one way to get a group's packages, the packages()
method of the group model. The group_package_show() action function
calls it.


Compare: https://github.com/okfn/ckan/compare/e4d4d28912b5^...83d2ef7bc43d


More information about the ckan-changes mailing list