コード例 #1
0
 def test_can_become_premium(self):
     self.addon.can_become_premium.return_value = True
     view = dec.can_become_premium(self.func)
     eq_(view(self.request, self.addon.pk, self.addon), True)
コード例 #2
0
ファイル: test_decorators.py プロジェクト: j-barron/zamboni
 def test_can_become_premium(self):
     self.addon.can_become_premium.return_value = True
     view = dec.can_become_premium(self.func)
     eq_(view(self.request, self.addon.pk, self.addon), True)
コード例 #3
0
 def test_cant_become_premium(self):
     self.addon.can_become_premium.return_value = False
     view = dec.can_become_premium(self.func)
     with self.assertRaises(PermissionDenied):
         view(self.request, self.addon.pk, self.addon)
コード例 #4
0
ファイル: test_decorators.py プロジェクト: j-barron/zamboni
 def test_cant_become_premium(self):
     self.addon.can_become_premium.return_value = False
     view = dec.can_become_premium(self.func)
     with self.assertRaises(PermissionDenied):
         view(self.request, self.addon.pk, self.addon)