def test_has_purchased_failure(self):
     view = dec.has_purchased(self.func)
     self.addon.is_premium.return_value = True
     self.addon.has_purchased.return_value = False
     with self.assertRaises(PermissionDenied):
         view(self.request, self.addon)
Esempio n. 2
0
 def test_has_purchased_failure(self):
     view = dec.has_purchased(self.func)
     self.addon.is_premium.return_value = True
     self.addon.has_purchased.return_value = False
     with self.assertRaises(PermissionDenied):
         view(self.request, self.addon)
 def test_has_purchased(self):
     view = dec.has_purchased(self.func)
     self.addon.is_premium.return_value = True
     self.addon.has_purchased.return_value = True
     eq_(view(self.request, self.addon), True)
Esempio n. 4
0
 def test_has_purchased(self):
     view = dec.has_purchased(self.func)
     self.addon.is_premium.return_value = True
     self.addon.has_purchased.return_value = True
     eq_(view(self.request, self.addon), True)