add in app:// origins to the receipt (bug 867265)
This commit is contained in:
Родитель
4ba53ff8eb
Коммит
da0d062fd6
|
@ -141,7 +141,14 @@ class TestReceipt(amo.tests.TestCase):
|
|||
user = UserProfile.objects.get(pk=5497308)
|
||||
ins = self.create_install(user, webapp)
|
||||
receipt = self.for_user(ins, 'developer')
|
||||
eq_(receipt['product']['url'], 'http://testserver')
|
||||
eq_(receipt['product']['url'], 'app://foo.com')
|
||||
|
||||
def test_receipt_packaged_no_origin(self):
|
||||
webapp = addon_factory(type=amo.ADDON_WEBAPP, is_packaged=True)
|
||||
user = UserProfile.objects.get(pk=5497308)
|
||||
ins = self.create_install(user, webapp)
|
||||
receipt = self.for_user(ins, 'developer')
|
||||
eq_(receipt['product']['url'], settings.SITE_URL)
|
||||
|
||||
@mock.patch.object(settings, 'SIGNING_SERVER_ACTIVE', True)
|
||||
@mock.patch('mkt.receipts.utils.sign')
|
||||
|
|
|
@ -22,9 +22,9 @@ def create_receipt(installed, flavour=None):
|
|||
typ = 'purchase-receipt'
|
||||
|
||||
product = {'storedata': urlencode({'id': int(webapp.pk)}),
|
||||
# Trunion needs to see https:// URLs.
|
||||
'url': settings.SITE_URL
|
||||
if webapp.is_packaged else webapp.origin}
|
||||
# Packaged and hosted apps should have an origin. If there
|
||||
# isn't one, fallback to the SITE_URL.
|
||||
'url': webapp.origin or settings.SITE_URL}
|
||||
|
||||
# Generate different receipts for reviewers or developers.
|
||||
expiry = time_ + settings.WEBAPPS_RECEIPT_EXPIRY_SECONDS
|
||||
|
|
Загрузка…
Ссылка в новой задаче