analytics: Send zeros for data.user.bot in Messages Sent Over Time.

It will simplify the logic needed to process the "Sent by Me" view in
Messages Sent Over Time in stats.js.

Also, we gzip the data sent from our server, so there is little additional
network usage by doing this.
This commit is contained in:
Rishi Gupta
2017-03-25 13:48:37 -07:00
committed by Tim Abbott
parent 16b2313165
commit 9f60dd8387
2 changed files with 9 additions and 9 deletions

View File

@@ -97,7 +97,7 @@ class TestGetChartData(ZulipTestCase):
'frequency': CountStat.HOUR,
'interval': CountStat.HOUR,
'realm': {'bot': self.data(100), 'human': self.data(101)},
'user': {'human': self.data(200)},
'user': {'bot': self.data(0), 'human': self.data(200)},
'display_order': None,
'result': 'success',
})
@@ -170,7 +170,7 @@ class TestGetChartData(ZulipTestCase):
self.assert_json_success(result)
data = ujson.loads(result.content)
self.assertEqual(data['realm'], {'human': [0], 'bot': [0]})
self.assertEqual(data['user'], {})
self.assertEqual(data['user'], {'human': [0], 'bot': [0]})
FillState.objects.create(
property='messages_sent:message_type:day', end_time=self.end_times_day[0], state=FillState.DONE)