Skip to content

Commit

Permalink
Merge pull request #4291 from inspirehep/fix-reply-ticket
Browse files Browse the repository at this point in the history
workflows: fix reply_ticket
  • Loading branch information
drjova authored Jun 27, 2023
2 parents 282ec9b + 33a68fc commit a02dbc0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions inspirehep/modules/workflows/tasks/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def _reply_ticket(obj, eng):
return {}
if current_app.config.get("FEATURE_FLAG_ENABLE_SNOW"):
reply_snow_ticket(obj, ticket_id, context_factory, user, template)
return {}
else:
if not rt_instance:
obj.log.error("No RT instance available. Skipping!")
Expand Down
8 changes: 6 additions & 2 deletions tests/integration/workflows/test_workflow_tasks_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ def test_reply_ticket_calls_tickets_reply_when_template_is_not_set(workflow_app)
obj = workflow_object_class.create(
data=data, extra_data=extra_data, id_user=1, data_type="hep"
)
expected_result = {}
_reply_ticket = reply_ticket()
_reply_ticket(obj, None)
result = _reply_ticket(obj, None)
assert expected_result == result
assert (
request_mocker.request_history[0]._request.body
== '{"ticket_id": "1", "reply_message": "reply reason"}'
Expand Down Expand Up @@ -61,7 +63,9 @@ def test_reply_ticket_calls_tickets_reply_when_template_is_set(workflow_app):
_reply_ticket = reply_ticket(
context_factory=reply_ticket_context, template="test.html"
)
_reply_ticket(obj, None)
expected_result = {}
result = _reply_ticket(obj, None)
assert expected_result == result
assert (
request_mocker.request_history[0]._request.body
== '{"template_context": {"reason": "", "record_url": "", "user_name": "[email protected]", "title": "Partial Symmetries of Weak Interactions"}, "ticket_id": "1", "template": "test"}'
Expand Down

0 comments on commit a02dbc0

Please sign in to comment.