Added test that the token can be signed and retrieved

This commit is contained in:
Rebecca Law
2016-01-13 14:34:45 +00:00
parent 725b976d31
commit a6dda26ba1
2 changed files with 12 additions and 2 deletions

View File

@@ -318,6 +318,15 @@ def test_delete_token(notify_api, notify_db, notify_db_session, sample_service):
assert len(Token.query.all()) == 0
def test_token_generated_can_be_read_again(notify_api):
from app.service.views.rest import (_generate_token, _get_token)
import uuid
with notify_api.test_request_context():
token = str(uuid.uuid4())
signed_token = _generate_token(token=token)
assert token == _get_token(signed_token)
def test_create_template(notify_api, notify_db, notify_db_session, sample_service):
"""
Tests POST endpoint '/<service_id>/template' a template can be created