Skip to content

Commit 1b072c2

Browse files
committed
Updated device lookup to test for absent date returned through the api
1 parent 464726a commit 1b072c2

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

tests/devices/test_device_info.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_channel_lookup(self):
5858
'background': 'false',
5959
'push_address': '3C0590EBCC11618723B3D4C8AA60BCFB6',
6060
'created': '2014-04-17T23:35:15',
61-
'last_registration': '2014-08-11T20:47:28',
61+
'last_registration': 'None',
6262
'alias': 'null',
6363
'tags': ['test_tag'],
6464
'ios': {
@@ -86,12 +86,6 @@ def test_channel_lookup(self):
8686
'%Y-%m-%dT%H:%M:%S'
8787
)
8888
)
89-
last_registration_date = (
90-
datetime.datetime.strptime(
91-
'2014-08-11T20:47:28',
92-
'%Y-%m-%dT%H:%M:%S'
93-
)
94-
)
9589

9690
self.assertEqual(channel_lookup.channel_id, channel_id)
9791
self.assertEqual(channel_lookup.device_type, 'ios')
@@ -107,7 +101,7 @@ def test_channel_lookup(self):
107101
)
108102
self.assertEqual(
109103
channel_lookup.last_registration,
110-
last_registration_date
104+
'UNKNOWN'
111105
)
112106
self.assertEqual(
113107
channel_lookup.ios,

tests/devices/test_device_listing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_channel_listing(self):
8080
"opt_in": "false",
8181
"background": "false",
8282
"push_address": "dBxM9bDfoBc:APA91bEVEmD6qDehBmYz7xHDwxuv9dYZN9iegJGUBUpV17P51JafpjYrCmSZQkJUkBuKKmizk0eXwxT3UT_gpReFs2aXnp3UdjJ_DhuH1DYBmw_HuOQjI0oklU8DWVr1aurIP2Q3K5We",
83-
'created': 'randomthing',
83+
'created': 'None',
8484
"last_registration": "2016-08-22T17:20:27",
8585
"named_user_id": "null",
8686
"alias": "null",
@@ -118,6 +118,6 @@ def test_channel_listing(self):
118118
self.assertEquals(channel_responses[1].device_type, 'android')
119119

120120
self.assertEquals(channel_responses[0].created, '2016-08-17T23:29:52')
121-
self.assertEquals(channel_responses[1].created, 'UNKNOWN')
121+
self.assertEquals(channel_responses[1].created, 'None')
122122

123123

0 commit comments

Comments
 (0)