Skip to content

Commit

Permalink
Fix status change free-inapp (bug 892905)
Browse files Browse the repository at this point in the history
  • Loading branch information
muffinresearch authored and cvan committed Jul 12, 2013
1 parent ab2da66 commit 3f58800
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
3 changes: 0 additions & 3 deletions mkt/developers/forms_payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,6 @@ def save(self):
log.debug('[1@%s] Removing upsell; switching to free '
'with in_app' % self.addon.pk)
upsell.delete()

if self.addon.status == amo.STATUS_NULL:
_restore_app(self.addon, save=False)
else:
# The dev is submitting updates for payment data about a paid
# app. This might also happen if he/she is associating a new
Expand Down
22 changes: 17 additions & 5 deletions mkt/developers/tests/test_views_payments.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,15 +384,27 @@ def test_made_free_inapp_has_free_selected(self):
pqr = pq(res.content)
eq_(pqr('select[name=price] option[selected]').attr('value'), 'free')

def test_premium_to_free_with_inapp_is_pending(self):
self.webapp.update(premium_type=amo.ADDON_PREMIUM,
status=amo.STATUS_NULL,
highest_status=amo.STATUS_PENDING)
def test_free_with_inapp_without_account_is_incomplete(self):
self.webapp.update(premium_type=amo.ADDON_FREE)
# Toggle to paid
self.client.post(
self.url, self.get_postdata({'toggle-paid': 'paid'}))
res = self.client.post(
self.url, self.get_postdata({'price': 'free',
'allow_inapp': 'True'}))
self.assert3xx(res, self.url)
eq_(self.get_webapp().status, amo.STATUS_PENDING)
eq_(self.get_webapp().status, amo.STATUS_NULL)

def test_paid_app_without_account_is_incomplete(self):
self.webapp.update(premium_type=amo.ADDON_FREE)
# Toggle to paid
self.client.post(
self.url, self.get_postdata({'toggle-paid': 'paid'}))
res = self.client.post(
self.url, self.get_postdata({'price': self.price.pk,
'allow_inapp': 'False'}))
self.assert3xx(res, self.url)
eq_(self.get_webapp().status, amo.STATUS_NULL)

def test_associate_acct_to_app_free_inapp(self):
# Set up Solitude return values.
Expand Down

0 comments on commit 3f58800

Please sign in to comment.