Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
Make packaged apps default to is_offline
Browse files Browse the repository at this point in the history
  • Loading branch information
mstriemer committed Nov 24, 2014
1 parent bf7f64e commit bdce26b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mkt/webapps/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,9 @@ def guess_is_offline(self):
`appcache_path` defined in its manifest).
"""
if self.latest_version:
if self.is_packaged:
return True
elif self.latest_version:
# Manually find the latest file since `self.get_latest_file()`
# won't be set correctly near the start of the app submission
# process.
Expand Down
6 changes: 6 additions & 0 deletions mkt/webapps/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,12 @@ def test_guess_is_offline_no_manifest(self):
app = Webapp()
eq_(app.guess_is_offline(), False)

@mock.patch('mkt.webapps.models.cache.get')
def test_is_offline_when_packaged(self, mock_get):
mock_get.return_value = ''
eq_(Webapp(is_packaged=True).guess_is_offline(), True)
eq_(Webapp(is_packaged=False).guess_is_offline(), False)

@mock.patch('mkt.webapps.models.Webapp.has_payment_account')
def test_payments_complete(self, pay_mock):
# Default to complete if it's not needed.
Expand Down

0 comments on commit bdce26b

Please sign in to comment.