Ejemplo n.º 1
0
 def setUp(self):
     self.today = datetime.date.today()
     self.webapp = Addon.objects.get(pk=337141)
     self.user = UserProfile.objects.get(pk=999)
     self.client.login(username="******", password="******")
     self.in_ = Installed.objects.create(addon=self.webapp, user=self.user)
     Installed.index(search.extract_installed_count(self.in_), id=self.in_.pk)
     self.refresh("users_install")
Ejemplo n.º 2
0
 def test_search(self):
     in_ = Installed.objects.create(addon=self.webapp, user=self.user)
     res = search.extract_installed_count(in_)
     eq_(res['count'], 1)
     eq_(res['date'], self.today)
     eq_(res['addon'], self.webapp.pk)