def test_alert_dates(connection, alert, alert_payload):
"""Verifies alert date objects are converted correctly."""
httpretty.register_uri(
httpretty.GET, '{}/alerts?limit=50'.format(
matchlight.MATCHLIGHT_API_URL_V2
),
body=json.dumps({'alerts': [alert_payload]}),
content_type='application/json',
status=200
)
alerts = connection.alerts.filter(limit=50)
assert isinstance(alerts[0].date, datetime.datetime)
assert isinstance(alerts[0].last_modified, datetime.datetime)
评论列表
文章目录