Skip to content

Commit bf6dd1b

Browse files
committed
fix more sanctions tests
1 parent 860430b commit bf6dd1b

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

osf/models/sanctions.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ def _email_template_context(self,
565565
})
566566
else:
567567
context.update({
568+
'domain': osf_settings.DOMAIN,
568569
'user_fullname': user.fullname,
569570
'initiated_by_fullname': self.initiated_by.fullname,
570571
'registration_link': registration_link,
@@ -574,7 +575,9 @@ def _email_template_context(self,
574575
'reviewable_title': self._get_registration().title,
575576
'reviewable__id': self._get_registration()._id,
576577
'reviewable_absolute_url': self._get_registration().absolute_url,
577-
578+
'reviewable_provider_name': self._get_registration().provider.name,
579+
'reviewable_provider__id': self._get_registration().provider._id,
580+
'reviewable_provider': self._get_registration().provider.name,
578581
'reviewable_registered_from_absolute_url': self._get_registration().registered_from.absolute_url,
579582
'reviewable_withdrawal_justification': self._get_registration().withdrawal_justification,
580583
'reviewable_branched_from_node': self._get_registration().branched_from_node
@@ -890,6 +893,7 @@ def _email_template_context(self, user, node, is_authorizer=False, urls=None):
890893
'reviewable_absolute_url': self._get_registration().absolute_url,
891894
'reviewable_branched_from_node': self._get_registration().branched_from_node,
892895
'reviewable_provider_name': self._get_registration().provider.name,
896+
'reviewable_provider__id': self._get_registration().provider._id,
893897
'approval_time_span': approval_time_span,
894898
'reviewable_registered_from_absolute_url': self._get_registration().registered_from.absolute_url,
895899
})
@@ -1054,6 +1058,7 @@ def _email_template_context(self, user, node, is_authorizer=False, urls=None):
10541058
})
10551059
else:
10561060
context.update({
1061+
'domain': osf_settings.DOMAIN,
10571062
'initiated_by_fullname': self.initiated_by.fullname,
10581063
'project_name': self.target_registration.title,
10591064
'registration_link': registration_link,

osf_tests/test_node.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,8 @@ def test_template_has_no_parent(self, template):
421421
assert template.parent_node is None
422422

423423
def test_template_has_correct_affiliations(self, user, auth, project_with_affiliations):
424-
template = project_with_affiliations.use_as_template(auth=auth)
424+
with capture_notifications():
425+
template = project_with_affiliations.use_as_template(auth=auth)
425426
user_affiliations = user.get_institution_affiliations().values_list('institution__id', flat=True)
426427
project_affiliations = project_with_affiliations.affiliated_institutions.values_list('id', flat=True)
427428
template_affiliations = template.affiliated_institutions.values_list('id', flat=True)
@@ -4187,7 +4188,8 @@ def test_template_security(self, user, auth, project, pointee, component, subpro
41874188
visible_nodes = [x for x in project.nodes if x.can_view(other_user_auth)]
41884189

41894190
# create templated node
4190-
new = project.use_as_template(auth=other_user_auth)
4191+
with capture_notifications():
4192+
new = project.use_as_template(auth=other_user_auth)
41914193

41924194
assert new.title == self._default_title(project)
41934195

osf_tests/test_sanctions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ def test_moderated_sanction__no_identifier_created_until_moderator_approval(self
214214
provider.get_group('moderator').user_set.add(moderator)
215215

216216
# Admin approval
217-
registration.sanction.accept()
217+
with capture_notifications():
218+
registration.sanction.accept()
218219
assert not registration.get_identifier(category='doi')
219220

220221
# Moderator approval

website/templates/pending_embargo_admin.html.mako

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
% if is_moderated:
1818
If approved by all admin contributors, the registration will be submitted for moderator review.
1919
If the moderators approve, the registration will be embargoed until
20-
${embargo_end_date.date()}, at which time it will be made public as part of the
20+
${embargo_end_date}, at which time it will be made public as part of the
2121
<a href="${domain}/registries/${reviewable_provider__id if reviewable_provider__id else 'osf'}">${reviewable_provider_name if reviewable_provider__id else "OSF Registry"}</a>.
2222
% else:
2323
If approved by all admin contributors, the registration will be embargoed until
24-
${embargo_end_date.date()}, at which point it will be made public as part of the
24+
${embargo_end_date}, at which point it will be made public as part of the
2525
<a href="${domain}/registries/${reviewable_provider__id if reviewable_provider__id else 'osf'}">${reviewable_provider_name if reviewable_provider__id else "OSF Registry"}</a>.
2626
% endif
2727
</p>

0 commit comments

Comments
 (0)