-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #335 from EBI-Metagenomics/Hotfix/Disabling-ENA-Co…
…nsent-Ticket-Creation put a fix to prevent consent rt queues from being created
- Loading branch information
Showing
2 changed files
with
2 additions
and
43 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
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 |
---|---|---|
|
@@ -70,42 +70,6 @@ def test_notify_not_consent(self): | |
HTTP_AUTHORIZATION='Bearer {}'.format(self.get_token()) | ||
) | ||
|
||
assert len(responses.calls) == 1 | ||
call = responses.calls[0] | ||
assert call.request.url == settings.RT["url"] | ||
assert call.request.body == json.dumps(expected_body) | ||
|
||
@responses.activate | ||
@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires python3.6 or higher") | ||
def test_notify_consent(self): | ||
"""Test notify endpoint for consent requests | ||
""" | ||
expected_body = { | ||
"Requestor": "[email protected]", | ||
"Priority": "4", | ||
"Subject": "Test email subject", | ||
"Content": "Hi this is just an example", | ||
"Queue": settings.RT["ena_queue"], | ||
} | ||
|
||
responses.add( | ||
responses.POST, | ||
settings.RT["url"], | ||
status=200) | ||
|
||
post_data = { | ||
"from_email": "[email protected]", | ||
"subject": "Test email subject", | ||
"message": "Hi this is just an example", | ||
"is_consent": True | ||
} | ||
|
||
self.client.post( | ||
reverse('emgapi_v1:csrf-notify'), | ||
data=post_data, format='json', | ||
HTTP_AUTHORIZATION='Bearer {}'.format(self.get_token()) | ||
) | ||
|
||
assert len(responses.calls) == 1 | ||
call = responses.calls[0] | ||
assert call.request.url == settings.RT["url"] | ||
|