Skip to content

Commit

Permalink
Switch to use ISO format with timezone in serialized method
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah256 committed Jun 24, 2019
1 parent f4850da commit f46fcf5
Show file tree
Hide file tree
Showing 8 changed files with 587 additions and 587 deletions.
2 changes: 1 addition & 1 deletion estuary/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def serialized(self):
actual_key = getattr(self.__class__, key).db_property or key

if isinstance(value, datetime):
rv[actual_key] = value.isoformat()
rv[actual_key] = value.strftime('%Y-%m-%dT%H:%M:%SZ')
else:
rv[actual_key] = value

Expand Down
290 changes: 145 additions & 145 deletions tests/api/test_all_stories.py

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions tests/api/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def test_get_story_auth(mock_oidc, employee_type):
{
'advisories': [],
'commit': None,
'completion_time': '2017-04-02T19:39:06+00:00',
'creation_time': '2017-04-02T19:39:06+00:00',
'completion_time': '2017-04-02T19:39:06Z',
'creation_time': '2017-04-02T19:39:06Z',
'epoch': '0',
'extra': None,
'id': '2345',
Expand All @@ -110,7 +110,7 @@ def test_get_story_auth(mock_oidc, employee_type):
'resource_type': 'KojiBuild',
'module_builds': [],
'display_name': 'slf4j-1.7.4-4.el7_4',
'start_time': '2017-04-02T19:39:06+00:00',
'start_time': '2017-04-02T19:39:06Z',
'state': 1,
'tags': [],
'version': '1.7.4'
Expand Down
118 changes: 59 additions & 59 deletions tests/api/test_get_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,29 @@
},
'attached_advisories': [
{
'actual_ship_date': '2017-08-01T15:43:51+00:00',
'actual_ship_date': '2017-08-01T15:43:51Z',
'advisory_name': 'RHBA-2017:2251-02',
'content_types': [
'docker'
],
'created_at':'2017-04-03T14:47:23+00:00',
'created_at': '2017-04-03T14:47:23Z',
'id':'27825',
'issue_date':'2017-08-01T05:59:34+00:00',
'issue_date': '2017-08-01T05:59:34Z',
'product_name':'Red Hat Enterprise Linux',
'product_short_name':'RHEL',
'release_date':None,
'security_impact':'None',
'security_sla':None,
'state':'SHIPPED_LIVE',
'status_time':'2017-08-01T15:43:51+00:00',
'status_time': '2017-08-01T15:43:51Z',
'synopsis':'cifs-utils bug fix update',
'update_date':'2017-08-01T07:16:00+00:00'
'update_date': '2017-08-01T07:16:00Z'
}
],
'classification':'Red Hat',
'creation_time':'2017-04-02T19:39:06+00:00',
'creation_time': '2017-04-02T19:39:06Z',
'id':'12345',
'modified_time':'2018-02-07T19:30:47+00:00',
'modified_time': '2018-02-07T19:30:47Z',
'priority':'high',
'product_name':'Red Hat Enterprise Linux',
'product_version':'7.5',
Expand All @@ -65,22 +65,22 @@
'resolution': '',
'resolved_by_commits': [
{
'author_date': '2017-04-27T11:44:38+00:00',
'commit_date': '2017-04-27T11:44:38+00:00',
'author_date': '2017-04-27T11:44:38Z',
'commit_date': '2017-04-27T11:44:38Z',
'hash': '1263adb248ba633e205067e1ad6dc61931727c2d',
'log_message': 'Related: #12345 - fix xz'
},
{
'author_date': '2017-04-26T11:44:38+00:00',
'commit_date': '2017-04-26T11:44:38+00:00',
'author_date': '2017-04-26T11:44:38Z',
'commit_date': '2017-04-26T11:44:38Z',
'hash': '8a63adb248ba633e200067e1ad6dc61931727bad',
'log_message': 'Related: #12345 - fix xyz'
}
],
'reverted_by_commits': [
{
'author_date': '2017-04-27T11:44:38+00:00',
'commit_date': '2017-04-27T11:44:38+00:00',
'author_date': '2017-04-27T11:44:38Z',
'commit_date': '2017-04-27T11:44:38Z',
'hash': '5663adb248ba633e205067e1ad6dc61931727123',
'log_message': 'Revert: #12345'
}
Expand All @@ -97,7 +97,7 @@
'name': None,
'username': 'tbrady'
},
'author_date': '2017-04-26T11:44:38+00:00',
'author_date': '2017-04-26T11:44:38Z',
'branches': [
{
'name': 'some_branch_name',
Expand All @@ -107,30 +107,30 @@
],
'children': [
{
'author_date': '2017-04-27T11:44:38+00:00',
'commit_date': '2017-04-27T11:44:38+00:00',
'author_date': '2017-04-27T11:44:38Z',
'commit_date': '2017-04-27T11:44:38Z',
'hash': '5663adb248ba633e205067e1ad6dc61931727123',
'log_message': 'Revert: #12345'
}
],
'commit_date': '2017-04-26T11:44:38+00:00',
'commit_date': '2017-04-26T11:44:38Z',
'hash': '8a63adb248ba633e200067e1ad6dc61931727bad',
'koji_builds': [
],
'log_message':'Related: #12345 - fix xyz',
'parent':{
'author_date': '2017-04-27T11:44:38+00:00',
'commit_date': '2017-04-27T11:44:38+00:00',
'author_date': '2017-04-27T11:44:38Z',
'commit_date': '2017-04-27T11:44:38Z',
'hash': '1263adb248ba633e205067e1ad6dc61931727c2d',
'log_message': 'Related: #12345 - fix xz'
},
'related_bugs': [
{
'classification': 'Red Hat',
'creation_time': '2017-04-02T19:39:06+00:00',
'creation_time': '2017-04-02T19:39:06Z',
'id': '272895',
'modified_time': '2018-02-07T19:30:47+00:00',
'modified_time': '2018-02-07T19:30:47Z',
'priority': 'low',
'product_name': 'Satellite',
'product_version': '3',
Expand All @@ -143,9 +143,9 @@
},
{
'classification': 'Red Hat',
'creation_time': '2017-04-02T19:39:06+00:00',
'creation_time': '2017-04-02T19:39:06Z',
'id': '12345',
'modified_time': '2018-02-07T19:30:47+00:00',
'modified_time': '2018-02-07T19:30:47Z',
'priority': 'high',
'product_name': 'Red Hat Enterprise Linux',
'product_version': '7.5',
Expand All @@ -166,9 +166,9 @@
'resolved_bugs': [
{
'classification': 'Red Hat',
'creation_time': '2017-04-02T19:39:06+00:00',
'creation_time': '2017-04-02T19:39:06Z',
'id': '67890',
'modified_time': '2018-02-07T19:30:47+00:00',
'modified_time': '2018-02-07T19:30:47Z',
'priority': 'medium',
'product_name': 'Red Hat Enterprise Linux',
'product_version': '7.3',
Expand All @@ -181,9 +181,9 @@
},
{
'classification': 'Red Hat',
'creation_time': '2017-04-02T19:39:06+00:00',
'creation_time': '2017-04-02T19:39:06Z',
'id': '12345',
'modified_time': '2018-02-07T19:30:47+00:00',
'modified_time': '2018-02-07T19:30:47Z',
'priority': 'high',
'product_name': 'Red Hat Enterprise Linux',
'product_version': '7.5',
Expand All @@ -198,9 +198,9 @@
'reverted_bugs': [
{
'classification': 'Red Hat',
'creation_time': '2017-04-02T19:39:06+00:00',
'creation_time': '2017-04-02T19:39:06Z',
'id': '67890',
'modified_time': '2018-02-07T19:30:47+00:00',
'modified_time': '2018-02-07T19:30:47Z',
'priority': 'medium',
'product_name': 'Red Hat Enterprise Linux',
'product_version': '7.3',
Expand All @@ -218,13 +218,13 @@
],
'commit':{
'author_date': '2017-04-27T11:44:38+00:00',
'commit_date': '2017-04-27T11:44:38+00:00',
'author_date': '2017-04-27T11:44:38Z',
'commit_date': '2017-04-27T11:44:38Z',
'hash': '1263adb248ba633e205067e1ad6dc61931727c2d',
'log_message': 'Related: #12345 - fix xz'
},
'completion_time': '2017-04-02T19:39:06+00:00',
'creation_time': '2017-04-02T19:39:06+00:00',
'completion_time': '2017-04-02T19:39:06Z',
'creation_time': '2017-04-02T19:39:06Z',
'epoch': '0',
'extra': None,
'id': '2345',
Expand All @@ -236,7 +236,7 @@
'username': 'mprahl'
},
'release': '4.el7_4',
'start_time': '2017-04-02T19:39:06+00:00',
'start_time': '2017-04-02T19:39:06Z',
'state': 1,
'tags': [
{
Expand All @@ -247,7 +247,7 @@
'version': '1.7.4'
}),
('advisory', '27825', {
'actual_ship_date': '2017-08-01T15:43:51+00:00',
'actual_ship_date': '2017-08-01T15:43:51Z',
'advisory_name': 'RHBA-2017:2251-02',
'assigned_to': {
'email': 'matt.prahl@domain.local',
Expand All @@ -257,9 +257,9 @@
'attached_bugs': [
{
'classification': 'Red Hat',
'creation_time': '2017-04-02T19:39:06+00:00',
'creation_time': '2017-04-02T19:39:06Z',
'id': '12345',
'modified_time': '2018-02-07T19:30:47+00:00',
'modified_time': '2018-02-07T19:30:47Z',
'priority': 'high',
'product_name': 'Red Hat Enterprise Linux',
'product_version': '7.5',
Expand All @@ -273,24 +273,24 @@
],
'attached_builds': [
{
'completion_time': '2017-04-02T19:39:06+00:00',
'creation_time': '2017-04-02T19:39:06+00:00',
'completion_time': '2017-04-02T19:39:06Z',
'creation_time': '2017-04-02T19:39:06Z',
'epoch': '0',
'extra': None,
'id': '2345',
'name': 'slf4j',
'release': '4.el7_4',
'start_time': '2017-04-02T19:39:06+00:00',
'start_time': '2017-04-02T19:39:06Z',
'state': 1,
'version': '1.7.4'
}
],
'content_types': [
'docker'
],
'created_at':'2017-04-03T14:47:23+00:00',
'created_at': '2017-04-03T14:47:23Z',
'id':'27825',
'issue_date':'2017-08-01T05:59:34+00:00',
'issue_date': '2017-08-01T05:59:34Z',
'product_name': 'Red Hat Enterprise Linux',
'product_short_name': 'RHEL',
'release_date': None,
Expand All @@ -302,12 +302,12 @@
'security_impact': 'None',
'security_sla': None,
'state': 'SHIPPED_LIVE',
'status_time': '2017-08-01T15:43:51+00:00',
'status_time': '2017-08-01T15:43:51Z',
'synopsis': 'cifs-utils bug fix update',
'triggered_freshmaker_event': [
],
'update_date':'2017-08-01T07:16:00+00:00'
'update_date': '2017-08-01T07:16:00Z'
}),
('freshmakerevent', '1180', {
'event_type_id': 8,
Expand All @@ -323,46 +323,46 @@
'state': 1,
'state_name': 'DONE',
'state_reason': 'Built successfully.',
'time_completed': '2017-04-02T19:39:06+00:00',
'time_submitted': '2017-04-02T19:39:06+00:00',
'time_completed': '2017-04-02T19:39:06Z',
'time_submitted': '2017-04-02T19:39:06Z',
'type': 1,
'type_name': 'IMAGE',
'url': '/api/1/builds/398'
}],
'state': 2,
'state_name': 'COMPLETE',
'state_reason': 'All container images have been rebuilt',
'time_created': '2019-08-21T13:42:20+00:00',
'time_done': '2099-08-21T13:42:20+00:00',
'time_created': '2019-08-21T13:42:20Z',
'time_done': '2099-08-21T13:42:20Z',
'triggered_by_advisory': {
'actual_ship_date': '2017-08-01T15:43:51+00:00',
'actual_ship_date': '2017-08-01T15:43:51Z',
'advisory_name': 'RHBA-2017:2251-02',
'content_types': [
'docker'
],
'created_at':'2017-04-03T14:47:23+00:00',
'created_at': '2017-04-03T14:47:23Z',
'id':'27825',
'issue_date':'2017-08-01T05:59:34+00:00',
'issue_date': '2017-08-01T05:59:34Z',
'product_name':'Red Hat Enterprise Linux',
'product_short_name':'RHEL',
'release_date':None,
'security_impact':'None',
'security_sla':None,
'state':'SHIPPED_LIVE',
'status_time':'2017-08-01T15:43:51+00:00',
'status_time': '2017-08-01T15:43:51Z',
'synopsis':'cifs-utils bug fix update',
'update_date':'2017-08-01T07:16:00+00:00'
'update_date': '2017-08-01T07:16:00Z'
},
'successful_koji_builds': [{
'completion_time': '2017-04-02T19:39:06+00:00',
'creation_time': '2017-04-02T19:39:06+00:00',
'completion_time': '2017-04-02T19:39:06Z',
'creation_time': '2017-04-02T19:39:06Z',
'epoch': '0',
'extra': None,
'id': '710',
'name': 'slf4j_2',
'original_nvr': None,
'release': '4.el7_4_as',
'start_time': '2017-04-02T19:39:06+00:00',
'start_time': '2017-04-02T19:39:06Z',
'state': 1,
'version': '1.7.4'}]
}),
Expand All @@ -371,8 +371,8 @@
],
'commit':None,
'completion_time':'2017-04-02T19:39:06+00:00',
'creation_time':'2017-04-02T19:39:06+00:00',
'completion_time': '2017-04-02T19:39:06Z',
'creation_time': '2017-04-02T19:39:06Z',
'epoch':'0',
'extra':None,
'id':'710',
Expand All @@ -381,7 +381,7 @@
'original_nvr': None,
'owner':None,
'release':'4.el7_4_as',
'start_time':'2017-04-02T19:39:06+00:00',
'start_time': '2017-04-02T19:39:06Z',
'state':1,
'tags':[],
'triggered_by_freshmaker_event':None,
Expand Down

0 comments on commit f46fcf5

Please sign in to comment.