예제 #1
0
    def test_has_premium(self):
        webapp = Webapp(premium_type=amo.ADDON_PREMIUM)
        webapp._premium = mock.Mock()
        webapp._premium.price = 1
        eq_(webapp.has_premium(), True)

        webapp._premium.price = 0
        eq_(webapp.has_premium(), True)
예제 #2
0
파일: test_models.py 프로젝트: at13/zamboni
    def test_has_premium(self):
        webapp = Webapp(premium_type=amo.ADDON_PREMIUM)
        webapp._premium = mock.Mock()
        webapp._premium.price = 1
        eq_(webapp.has_premium(), True)

        webapp._premium.price = 0
        eq_(webapp.has_premium(), True)
예제 #3
0
 def test_get_price(self):
     # This test can be expensive to set up, lets just check it goes
     # down the stack.
     webapp = Webapp(premium_type=amo.ADDON_PREMIUM)
     webapp._premium = mock.Mock()
     webapp._premium.has_price.return_value = True
     webapp._premium.get_price.return_value = 1
     eq_(webapp.get_price(currency='USD'), 1)
예제 #4
0
    def test_has_price(self):
        webapp = Webapp(premium_type=amo.ADDON_PREMIUM)
        webapp._premium = mock.Mock()
        webapp._premium.price = None
        webapp._premium.has_price.return_value = True
        eq_(webapp.has_price(), True)

        webapp._premium.has_price.return_value = False
        eq_(webapp.has_price(), False)
예제 #5
0
    def test_has_price(self):
        webapp = Webapp(premium_type=amo.ADDON_PREMIUM)
        webapp._premium = mock.Mock()
        webapp._premium.price = None
        webapp._premium.has_price.return_value = True
        eq_(webapp.has_price(), True)

        webapp._premium.has_price.return_value = False
        eq_(webapp.has_price(), False)
예제 #6
0
 def test_has_no_premium(self):
     webapp = Webapp(premium_type=amo.ADDON_PREMIUM)
     webapp._premium = None
     eq_(webapp.has_price(), False)
예제 #7
0
 def test_has_no_premium(self):
     webapp = Webapp(premium_type=amo.ADDON_PREMIUM)
     webapp._premium = None
     eq_(webapp.has_price(), False)