Skip to content

Commit

Permalink
tests: fix tests related to ckan ini and plugin not available
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Sep 13, 2023
1 parent 98591fd commit f69e22e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ckanext/dcor_schemas/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def list_zombie_users(last_activity_weeks=12):
continue
# user has datasets?
if user.number_created_packages(include_private_and_draft=True) != 0:
# don't delete users with datasets
# don't list users with datasets
continue
# user has activities?
activity_objects = activity.model.activity.user_activity_list(
Expand Down
6 changes: 3 additions & 3 deletions ckanext/dcor_schemas/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ def test_zombies_basic_clean_db(cli):


@pytest.mark.ckan_config('ckan.plugins', 'dcor_schemas')
# We are not testing 'with_plugings', because otherwise the "activities"
# plugin is loaded which will create activities for our factory user.
@pytest.mark.usefixtures('clean_db', 'with_request_context')
# Test with the 'activity' plugin present.
@pytest.mark.usefixtures('clean_db', 'with_plugins', 'with_request_context')
def test_zombies_with_a_user(cli):
factories.User(name=f"test_user_{uuid.uuid4()}")
result = cli.invoke(ckan, ["list-zombie-users", "--last-activity-weeks",
"0"])
print(result) # for debugging
for line in result.output.split("\n"):
if not line.strip():
continue
Expand Down
2 changes: 1 addition & 1 deletion vagrant-run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set -e
set -x
# Set CKAN_INI to testing
export CKAN_INI=/etc/ckan/default/test-dcor.ini
export CKAN_INI=/etc/ckan/default/ckan.ini
# Go to the directory of this script
cd "$(dirname "${BASH_SOURCE[0]}")"
# Source the CKAN environment
Expand Down

0 comments on commit f69e22e

Please sign in to comment.