-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
55 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import json | ||
import uuid | ||
from datetime import datetime | ||
from datetime import datetime, timedelta | ||
from unittest import mock | ||
|
||
from django.conf import settings | ||
|
@@ -2835,6 +2835,42 @@ def test_execute_action_reject_version_delayed_rejection(self): | |
assert 'some review text' in mail.outbox[0].body | ||
assert '14 day(s)' in mail.outbox[0].body | ||
|
||
def test_execute_action_change_pending_rejection_date(self): | ||
addon = addon_factory(users=[user_factory(email='[email protected]')]) | ||
old_pending_rejection = self.days_ago(1) | ||
new_pending_rejection = datetime.now() + timedelta(days=1) | ||
version_review_flags_factory( | ||
version=addon.current_version, | ||
pending_rejection=old_pending_rejection, | ||
pending_rejection_by=user_factory(), | ||
pending_content_rejection=False, | ||
) | ||
decision = ContentDecision.objects.create( | ||
addon=addon, | ||
action=DECISION_ACTIONS.AMO_CHANGE_PENDING_REJECTION_DATE, | ||
action_date=datetime.now(), | ||
) | ||
ActivityLog.objects.create( | ||
amo.LOG.CHANGE_PENDING_REJECTION, | ||
addon, | ||
addon.current_version, | ||
decision, | ||
details={ | ||
'old_deadline': str(old_pending_rejection), | ||
'new_deadline': str(new_pending_rejection), | ||
}, | ||
user=user_factory(), | ||
) | ||
decision.execute_action_and_notify() | ||
assert ( | ||
'previous correspondence indicated that you would be required ' | ||
f'to correct the violation(s) by {old_pending_rejection}' | ||
) in mail.outbox[0].body | ||
assert ( | ||
'now require you to correct your add-on violations no later ' | ||
f'than {new_pending_rejection}' | ||
) in mail.outbox[0].body | ||
|
||
def test_resolve_job_forwarded(self): | ||
addon_developer = user_factory() | ||
addon = addon_factory(users=[addon_developer]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters