-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create moderation request on publish #1413
Create moderation request on publish #1413
Conversation
d963a24
to
9f2c5cb
Compare
tests/conftest.py
Outdated
|
||
# Users are verified by default. This will disable the automatic creation of moderation requests after publishing a record. | ||
# When testing unverified users, there is a "unverified_user" fixture for that purpose. | ||
app_config["ACCOUNTS_DEFAULT_VERIFIED_STATUS"] = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This simplifies testing.
That way, after publish
there are no moderation requests created in tests and it's easier to test user moderation (I created explicit users for that purpose).
is_verified = record.parent.is_verified | ||
|
||
# Owner might not resolve to a User (e.g. when the record was created by system) | ||
owner_exists = record.parent.access.owner.owner_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to identify if it's the system.
b335389
to
5306807
Compare
records_service.update_draft( | ||
unverified_user.identity, new_version.id, minimal_record | ||
) | ||
# Since tasks are executed synchronously in tests, the db session that is rolledback inside the session |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rephrase a bit to depict what is wrong?
@@ -47,11 +69,17 @@ def test_user_moderation_approve( | |||
|
|||
assert is_verified == False | |||
|
|||
moderation_request = mod_request_create(uploader.id) | |||
# Approve the user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outdated?
5306807
to
42f8967
Compare
6957ab3
to
32c273f
Compare
32c273f
to
905230d
Compare
closes inveniosoftware/invenio-requests#344
Needs: