This repository was archived by the owner on Mar 15, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 55
66from celery .task .sets import TaskSet
77
8- import addons .models
8+ import amo
9+ from addons .models import Webapp
910from lib .crypto .packaged import sign
10- from mkt . webapps . models import Webapp
11+
1112
1213HELP = """\
1314 Start tasks to re-sign web apps.
1920If omitted, all signed apps will be re-signed.
2021"""
2122
23+
2224log = logging .getLogger ('z.addons' )
2325
2426
@@ -27,12 +29,12 @@ class Command(BaseCommand):
2729 make_option ('--webapps' ,
2830 help = 'Webapp ids to process. Use commas to separate '
2931 'multiple ids.' ),
30- )
32+ )
3133
3234 help = HELP
3335
3436 def handle (self , * args , ** kw ):
35- qs = Webapp .objects .filter (is_packaged = True )
37+ qs = Webapp .objects .filter (is_packaged = True , status = amo . STATUS_PUBLIC )
3638 if kw ['webapps' ]:
3739 pks = [int (a .strip ()) for a in kw ['webapps' ].split (',' )]
3840 qs = qs .filter (pk__in = pks )
Original file line number Diff line number Diff line change @@ -111,6 +111,10 @@ def setUp(self):
111111 name = 'Mozillaball ょ' , app_slug = 'test' ,
112112 is_packaged = True , version_kw = {'version' : '1.0' ,
113113 'created' : None })
114+ self .app3 = amo .tests .app_factory (
115+ name = 'Test app 3' , app_slug = 'test3' , status = amo .STATUS_REJECTED ,
116+ is_packaged = True , version_kw = {'version' : '1.0' ,
117+ 'created' : None })
114118
115119 def test_by_webapp (self , sign_mock ):
116120 v1 = self .app .get_version ()
@@ -125,9 +129,10 @@ def test_all(self, sign_mock):
125129 call_command ('sign_apps' )
126130 file1 = v1 .all_files [0 ]
127131 file2 = v2 .all_files [0 ]
132+ eq_ (len (sign_mock .mock_calls ), 2 )
128133 sign_mock .assert_has_calls ([
129134 mock .call (file1 .file_path ,
130135 file1 .signed_file_path , False ),
131136 mock .call (file2 .file_path ,
132137 file2 .signed_file_path , False )],
133- any_order = True )
138+ any_order = True )
You can’t perform that action at this time.
0 commit comments