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

GitHub noreply at github.com
Tue Nov 27 21:40:22 UTC 2012


  Branch: refs/heads/add-shared-post-method-for-api-tests
  Home:   https://github.com/okfn/ckan
  Commit: eb55a659db75a21803a0a9bf66d50e6918152c87
      https://github.com/okfn/ckan/commit/eb55a659db75a21803a0a9bf66d50e6918152c87
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-27 (Tue, 27 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: 0235f1a812cd879c3f540807afb6a462f3ccecf3
      https://github.com/okfn/ckan/commit/0235f1a812cd879c3f540807afb6a462f3ccecf3
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-27 (Tue, 27 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: 5847bd00065b4fc92121432d57a002fc1fd688dd
      https://github.com/okfn/ckan/commit/5847bd00065b4fc92121432d57a002fc1fd688dd
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-27 (Tue, 27 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: 8f5c897c06633b1f2e7cb7d7cd78573fac5fb57d
      https://github.com/okfn/ckan/commit/8f5c897c06633b1f2e7cb7d7cd78573fac5fb57d
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-27 (Tue, 27 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: bdc72d7abd41fbdad5a5a30c8468ce6ea370ebc1
      https://github.com/okfn/ckan/commit/bdc72d7abd41fbdad5a5a30c8468ce6ea370ebc1
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-27 (Tue, 27 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.


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

  Changed paths:
    M ckan/logic/action/get.py
    M ckan/model/activity.py
    M ckan/tests/functional/api/test_dashboard.py

  Log Message:
  -----------
  Fix following of groups

Add activities from the datasets of followed groups into the user's
dashboard activity stream. All the test_dashboard.py tests now pass.

Move SQLAlchemy from group_activity_list() into model, alongside the SQLAlchemy
queries for the other types of activity stream.

Change the SQLAlchemy in activities_from_groups_followed_by_user() to be the
union of group_activity_list() for each of the followed groups.

Update some tests.


  Commit: 8e2f2a0baa703998337e3f035ab97064341cca4d
      https://github.com/okfn/ckan/commit/8e2f2a0baa703998337e3f035ab97064341cca4d
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-27 (Tue, 27 Nov 2012)

  Changed paths:
    M ckan/model/activity.py

  Log Message:
  -----------
  Add docstring to group_activity_list()


  Commit: 3a8c37c41efa548a0f59f475e01c748a3a0669d6
      https://github.com/okfn/ckan/commit/3a8c37c41efa548a0f59f475e01c748a3a0669d6
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-27 (Tue, 27 Nov 2012)

  Changed paths:
    M ckan/model/activity.py

  Log Message:
  -----------
  Add some docstrings to model/activity.py


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

  Changed paths:
    M ckan/model/activity.py
    M ckan/tests/functional/api/test_dashboard.py

  Log Message:
  -----------
  Fix dashboard activity stream from followed groups

It was returning all activities from the entire site, fix to return
activities from followed groups only.

The tests didn't catch this error because they didn't test doing random
activities that should _not_ appear in the user's dashboard and
asserting that they don't.

Add a quick test that catches this.

This is probably a problem for the other activity streams tests in
test_activity.py as well.


  Commit: bc179530aa05f3aa8ff6927f31ba298234093085
      https://github.com/okfn/ckan/commit/bc179530aa05f3aa8ff6927f31ba298234093085
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-27 (Tue, 27 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/activity.py
    M ckan/model/group.py
    M ckan/tests/functional/api/test_activity.py
    M ckan/tests/functional/api/test_dashboard.py
    M ckan/tests/functional/api/test_follow.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:
  -----------
  Merge branch 'master' of github.com:okfn/ckan


  Commit: 9eedc534c755a7433d1c6f8e21872486acf51315
      https://github.com/okfn/ckan/commit/9eedc534c755a7433d1c6f8e21872486acf51315
  Author: Sean Hammond <seanhammond at lavabit.com>
  Date:   2012-11-27 (Tue, 27 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/activity.py
    M ckan/model/group.py
    M ckan/tests/functional/api/test_activity.py
    M ckan/tests/functional/api/test_dashboard.py
    M ckan/tests/functional/api/test_follow.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:
  -----------
  Merge branch 'master' of github.com:okfn/ckan into add-shared-post-method-for-api-tests


Compare: https://github.com/okfn/ckan/compare/d6c1e1cacb01...9eedc534c755


More information about the ckan-changes mailing list