-
Notifications
You must be signed in to change notification settings - Fork 333
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
[ENG-6645] Fix api1_and_js failing tests - Part 1 (replaces #10832) #10879
[ENG-6645] Fix api1_and_js failing tests - Part 1 (replaces #10832) #10879
Conversation
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.
In addition to comments, please take a look at 12 remaining failures. Fix them if easy, postpone them to another ticket if challenging.
- 5 occurrences
api/preprints/views.py:91: in delete
return super().delete(request, *args, **kwargs)
E AttributeError: 'super' object has no attribute 'delete'
- 2 occurrences
api/preprints/views.py:117: in get_preprint
if preprint.deleted is not None:
E AttributeError: 'NoneType' object has no attribute 'deleted'
- Others
______________ TestPreprintProviderWithdrawalRequstList.test_list ______________
api_tests/providers/preprints/views/test_preprint_provider_request_list.py:49: in test_list
assert len(res.json['data']) == 1
E assert 0 == 1
E + where 0 = len([])
___________ TestPreprintActionFilters.test_filter_actions[moderator] ___________
api_tests/reviews/mixins/filter_mixins.py:146: in test_filter_actions
assert expected == actual
E AssertionError
__________ TestPreprintActionFilters.test_filter_actions[node_admin] ___________
api_tests/reviews/mixins/filter_mixins.py:146: in test_filter_actions
assert expected == actual
E AssertionError
_______________ TestPreprintVersion.test_pending_version_exists ________________
api_tests/preprints/views/test_preprint_versions.py:71: in test_pending_version_exists
assert res.status_code == 409
E assert 201 == 409
E + where 201 = <201 Created application/vnd.api+json body=b'{"data":...0"}}'/2594>.status_code
_________________ TestReviewActionFilters.test_filter_actions __________________
api_tests/reviews/mixins/filter_mixins.py:146: in test_filter_actions
assert expected == actual
E AssertionError
Rebased to fix conflicts and your previous one has been backed up in https://github.com/cslzchen/osf.io/tree/fix/ENG-6645-backup-before-rebase |
… unneccessery changes in mixins.py
@@ -148,7 +148,7 @@ def test_claim_unauth_success_with_unknown_email(self, app, url, project, unreg_ | |||
def test_claim_unauth_success_with_preprint_id(self, app, url, preprint, unreg_user, mock_mail): | |||
res = app.post_json_api( | |||
url.format(unreg_user._id), | |||
self.payload(email='[email protected]', id=preprint._id), | |||
self.payload(email='[email protected]', id=preprint.get_guid()._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.
hmm, get_guid()._id
returns the latest version while id=preprint._id
returns the current version, with this if, I think we are sending the the wrong email to pass the tests.
Here is the failure and I think we may have an actual bug.
FAILED api_tests/users/views/test_user_claim.py::TestClaimUser::test_claim_unauth_success_with_preprint_id - webtest.app.AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for http://localhost/v2/users/f8upx/claim/)
{"errors":[{"detail":"Unable to find specified record."}],"meta":{"version":"2.0"}}
I will revert the change in this PR and create another ticket on fixing this correctly.
Test: test_claim_unauth_success_with_preprint_id
Test: test_preprint_contributor_signal_sent_on_creation
6d4313b
into
CenterForOpenScience:feature/preprints-doi-versioning
Purpose
Fix failing tests in api1_and_js
Replaces: #10832
Changes
Fix failing tests in api1_and_js
QA Notes
N/A
Documentation
N/A
Side Effects
N/A
Ticket
https://openscience.atlassian.net/browse/ENG-6645