示例#1
0
 def test_patch_permissions_pk_clash(self):
     # By default, the File and Version objects we are creating share the
     # same pk, and this can hide bugs. Create a new File to specifically
     # test a scenario where they don't share the same pk.
     self.file.delete()
     self.new_file = file_factory(version=self.version)
     self.grant_permission(self.user, 'Admin:%')
     data, res = self.do_patch(data={'status': 'pending'})
     eq_(res.status_code, 200)
     # Note: the app is incomplete since we deleted its public file above
     # and this time we haven't patched is_fully_complete().
     eq_(json.loads(res.content), {'status': 'pending',
                                   'app_status': 'incomplete'})
     eq_(self.new_file.reload().status, mkt.STATUS_PENDING)
示例#2
0
 def test_patch_permissions_pk_clash(self):
     # By default, the File and Version objects we are creating share the
     # same pk, and this can hide bugs. Create a new File to specifically
     # test a scenario where they don't share the same pk.
     self.file.delete()
     self.new_file = file_factory(version=self.version)
     self.grant_permission(self.user, 'Admin:%')
     data, res = self.do_patch(data={'status': 'pending'})
     eq_(res.status_code, 200)
     # Note: the app is incomplete since we deleted its public file above
     # and this time we haven't patched is_fully_complete().
     eq_(json.loads(res.content), {'status': 'pending',
                                   'app_status': 'incomplete'})
     eq_(self.new_file.reload().status, mkt.STATUS_PENDING)
示例#3
0
 def test_packaged_app_deleted(self):
     self.app.update(is_packaged=True)
     ver = version_factory(addon=self.app)
     file_factory(version=ver)
     self.app.delete()
     self.summary()