Родитель
4eb7b1c714
Коммит
d79a76f4da
|
@ -67,12 +67,6 @@ def _update_addon_average_daily_users(data, **kw):
|
||||||
task_log.debug(m % (count, pk))
|
task_log.debug(m % (count, pk))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if (count - addon.total_downloads) > 10000:
|
|
||||||
# Adjust ADU to equal total downloads so bundled add-ons don't
|
|
||||||
# skew the results when sorting by users.
|
|
||||||
task_log.info('Readjusted ADU count for addon %s' % addon.slug)
|
|
||||||
addon.update(average_daily_users=addon.total_downloads)
|
|
||||||
else:
|
|
||||||
addon.update(average_daily_users=count)
|
addon.update(average_daily_users=count)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -200,17 +200,6 @@ class AvgDailyUserCountTestCase(TestCase):
|
||||||
super(AvgDailyUserCountTestCase, self).setUp()
|
super(AvgDailyUserCountTestCase, self).setUp()
|
||||||
self.create_switch('local-statistics-processing')
|
self.create_switch('local-statistics-processing')
|
||||||
|
|
||||||
def test_adu_is_adjusted_in_cron(self):
|
|
||||||
addon = Addon.objects.get(pk=3615)
|
|
||||||
assert addon.average_daily_users == 6000000
|
|
||||||
assert \
|
|
||||||
addon.average_daily_users > addon.total_downloads + 10000, \
|
|
||||||
('Unexpected ADU count. ADU of %d not greater than %d' % (
|
|
||||||
addon.average_daily_users, addon.total_downloads + 10000))
|
|
||||||
cron._update_addon_average_daily_users([(3615, 6000000)])
|
|
||||||
addon = Addon.objects.get(pk=3615)
|
|
||||||
assert addon.average_daily_users == addon.total_downloads
|
|
||||||
|
|
||||||
def test_13_day_window(self):
|
def test_13_day_window(self):
|
||||||
addon = Addon.objects.get(pk=3615)
|
addon = Addon.objects.get(pk=3615)
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче