Fixing test to take python3 into account. (#460)

* Fixing test to take python3 into account.
This commit is contained in:
kevgliss 2016-10-31 17:02:08 -07:00 committed by GitHub
parent 1ac1a44e83
commit d99681904e
1 changed files with 26 additions and 27 deletions

View File

@ -5,30 +5,29 @@ def test_formatting(certificate):
from lemur.notifications.service import _get_message_data
data = [_get_message_data(certificate)]
attachments = [
{
'title': 'certificate0',
'color': 'danger',
'fields': [
{
'short': True,
'value': 'joe@example.com',
'title': 'Owner'
},
{
'short': True,
'value': u'Wednesday, January 1, 2020',
'title': 'Expires'
}, {
'short': True,
'value': 0,
'title': 'Endpoints Detected'
}
],
'title_link': 'https://lemur.example.com/#/certificates/certificate0',
'mrkdwn_in': ['text'],
'text': '',
'fallback': ''
}
]
assert attachments == create_expiration_attachments(data)
attachment = {
'title': certificate.name,
'color': 'danger',
'fields': [
{
'short': True,
'value': 'joe@example.com',
'title': 'Owner'
},
{
'short': True,
'value': u'Wednesday, January 1, 2020',
'title': 'Expires'
}, {
'short': True,
'value': 0,
'title': 'Endpoints Detected'
}
],
'title_link': 'https://lemur.example.com/#/certificates/{name}'.format(name=certificate.name),
'mrkdwn_in': ['text'],
'text': '',
'fallback': ''
}
assert attachment == create_expiration_attachments(data)[0]