def test_weekly_downloads(self): eq_(self.get_webapp().weekly_downloads, 0) self.add_install() self.add_install(user=UserProfile.objects.get(pk=10482), created=datetime.today() - timedelta(days=2)) update_weekly_downloads() eq_(self.get_webapp().weekly_downloads, 2)
def test_addon(self): self.addon.update(type=amo.ADDON_EXTENSION) self.add_install() update_weekly_downloads() eq_(Addon.objects.get(pk=self.addon.pk).weekly_downloads, 0)
def test_long_ago(self): self.add_install(created=datetime.today() - timedelta(days=8)) update_weekly_downloads() eq_(self.get_webapp().weekly_downloads, 0)
def test_recently(self): self.add_install(created=datetime.today() - timedelta(days=7)) update_weekly_downloads() eq_(self.get_webapp().weekly_downloads, 1)