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