cope with other premium statuses (bug 747504)
This commit is contained in:
Родитель
32ea300517
Коммит
e83e6bbe03
|
@ -158,6 +158,15 @@ class TestVerify(amo.tests.TestCase):
|
|||
res = self.get(3615, self.user_data)
|
||||
eq_(res['status'], 'refunded')
|
||||
|
||||
def test_other_premiums(self):
|
||||
for k in (amo.ADDON_FREE, amo.ADDON_PREMIUM_INAPP,
|
||||
amo.ADDON_FREE_INAPP, amo.ADDON_PREMIUM_OTHER):
|
||||
Installed.objects.all().delete()
|
||||
self.addon.update(premium_type=k)
|
||||
self.make_install()
|
||||
res = self.get(3615, self.user_data)
|
||||
eq_(res['status'], 'ok')
|
||||
|
||||
def test_product_wrong_store_data(self):
|
||||
self.make_install()
|
||||
data = self.user_data.copy()
|
||||
|
|
|
@ -23,8 +23,9 @@ from lib.log_settings_base import formatters, handlers, loggers
|
|||
# remove all this.
|
||||
from constants.applications import APPS_ALL
|
||||
from constants.platforms import PLATFORMS
|
||||
from constants.base import (STATUS_PUBLIC, STATUS_DISABLED, STATUS_BETA,
|
||||
STATUS_LITE, STATUS_LITE_AND_NOMINATED)
|
||||
from constants.base import (ADDON_PREMIUM, STATUS_PUBLIC, STATUS_DISABLED,
|
||||
STATUS_BETA, STATUS_LITE,
|
||||
STATUS_LITE_AND_NOMINATED)
|
||||
from constants.payments import (CONTRIB_CHARGEBACK, CONTRIB_PURCHASE,
|
||||
CONTRIB_REFUND)
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ from time import gmtime, time
|
|||
from urlparse import parse_qsl
|
||||
|
||||
from utils import (log_configure, log_exception, log_info, mypool,
|
||||
settings, CONTRIB_CHARGEBACK, CONTRIB_PURCHASE,
|
||||
CONTRIB_REFUND)
|
||||
settings, ADDON_PREMIUM, CONTRIB_CHARGEBACK,
|
||||
CONTRIB_PURCHASE, CONTRIB_REFUND)
|
||||
|
||||
# Go configure the log.
|
||||
log_configure()
|
||||
|
@ -91,7 +91,7 @@ class Verify:
|
|||
|
||||
# If it's a premium addon, then we need to get that the purchase
|
||||
# information.
|
||||
if not premium:
|
||||
if premium != ADDON_PREMIUM:
|
||||
self.log('Valid receipt, not premium')
|
||||
return self.ok_or_expired(receipt)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче