def test_rejected(self): comments = "oh no you di'nt!!" mkt.set_user(UserProfile.objects.get(email='*****@*****.**')) mkt.log(mkt.LOG.REJECT_VERSION, self.webapp, self.webapp.current_version, user_id=999, details={'comments': comments, 'reviewtype': 'pending'}) self.webapp.update(status=mkt.STATUS_REJECTED) make_rated(self.webapp) (self.webapp.versions.latest() .all_files[0].update(status=mkt.STATUS_REJECTED)) r = self.client.get(self.url) eq_(r.status_code, 200) doc = pq(r.content)('#version-status') eq_(doc('.status-rejected').length, 1) eq_(doc('#rejection').length, 1) eq_(doc('#rejection blockquote').text(), comments) my_reply = 'fixed just for u, brah' r = self.client.post(self.url, {'notes': my_reply, 'resubmit-app': ''}) self.assert3xx(r, self.url, 302) webapp = self.get_webapp() eq_(webapp.status, mkt.STATUS_PENDING, 'Reapplied apps should get marked as pending') eq_(webapp.versions.latest().all_files[0].status, mkt.STATUS_PENDING, 'Files for reapplied apps should get marked as pending') action = mkt.LOG.WEBAPP_RESUBMIT assert AppLog.objects.filter( addon=webapp, activity_log__action=action.id).exists(), ( "Didn't find `%s` action in logs." % action.short)
def test_rejected(self): comments = "oh no you di'nt!!" mkt.set_user(UserProfile.objects.get(email='*****@*****.**')) mkt.log(mkt.LOG.REJECT_VERSION, self.webapp, self.webapp.current_version, user_id=999, details={'comments': comments, 'reviewtype': 'pending'}) self.webapp.update(status=mkt.STATUS_REJECTED) make_rated(self.webapp) (self.webapp.versions.latest() .all_files[0].update(status=mkt.STATUS_DISABLED)) r = self.client.get(self.url) eq_(r.status_code, 200) doc = pq(r.content)('#version-status') eq_(doc('.status-rejected').length, 1) eq_(doc('#rejection').length, 1) eq_(doc('#rejection blockquote').text(), comments) my_reply = 'fixed just for u, brah' r = self.client.post(self.url, {'notes': my_reply, 'resubmit-app': ''}) self.assert3xx(r, self.url, 302) webapp = self.get_webapp() eq_(webapp.status, mkt.STATUS_PENDING, 'Reapplied apps should get marked as pending') eq_(webapp.versions.latest().all_files[0].status, mkt.STATUS_PENDING, 'Files for reapplied apps should get marked as pending') action = mkt.LOG.WEBAPP_RESUBMIT assert AppLog.objects.filter( addon=webapp, activity_log__action=action.id).exists(), ( "Didn't find `%s` action in logs." % action.short)
def test_comm_thread_after_resubmission(self): self.webapp.update(status=mkt.STATUS_REJECTED) make_rated(self.webapp) mkt.set_user(UserProfile.objects.get(email='*****@*****.**')) (self.webapp.versions.latest().all_files[0].update( status=mkt.STATUS_DISABLED)) my_reply = 'no give up' self.client.post(self.url, {'notes': my_reply, 'resubmit-app': ''}) notes = CommunicationNote.objects.all() eq_(notes.count(), 1) eq_(notes[0].body, my_reply)
def test_comm_thread_after_resubmission(self): self.webapp.update(status=mkt.STATUS_REJECTED) make_rated(self.webapp) mkt.set_user(UserProfile.objects.get(email='*****@*****.**')) (self.webapp.versions.latest() .all_files[0].update(status=mkt.STATUS_REJECTED)) my_reply = 'no give up' self.client.post(self.url, {'notes': my_reply, 'resubmit-app': ''}) notes = CommunicationNote.objects.all() eq_(notes.count(), 1) eq_(notes[0].body, my_reply)
def setUp(self): super(TestVersionPackaged, self).setUp() self.login('*****@*****.**') self.app.update(is_packaged=True) self.app = self.get_app() # Needed for various status checking routines on fully complete apps. make_rated(self.app) if not self.app.categories: self.app.update(categories=['utilities']) self.app.addondevicetype_set.create(device_type=DEVICE_TYPES.keys()[0]) self.app.previews.create() self.url = self.app.get_dev_url('versions') self.delete_url = self.app.get_dev_url('versions.delete')