35
response._content = '[["2010-12-24", 4], ["2010-12-25", 1]]'
36
response._content = '[["2010-12-24", 4], ["2010-12-25", 1]]'
38
41
store.session = FakeSession
39
42
update_counts(CharmSource(self.db, index_client), store, log)
40
43
db_charm = self.db.charms.find_one({'_id': charm_id})
41
44
self.assertEqual(5, db_charm['downloads_in_past_30_days'])
42
46
index_charm = index_client.get(charm_id)
43
47
self.assertEqual(5, index_charm['downloads_in_past_30_days'])
45
50
def test_update_no_index(self):
46
51
charm_id, charm = factory.makeCharm(self.db)