def test_refresh_does_not_have_cert(self, refresh_iarc_ratings_delay_mock): refresh_iarc_ratings.Command().handle() eq_(refresh_iarc_ratings_delay_mock.call_count, 0) # Having IARCInfo objects should not matter, if we have no IARCCert, # we can't refresh ratings. IARCInfo.objects.create(addon=self.app, submission_id=52, security_code='FZ32CU8') refresh_iarc_ratings.Command().handle() eq_(refresh_iarc_ratings_delay_mock.call_count, 0)
def test_refresh_has_cert(self, refresh_iarc_ratings_delay_mock): IARCCert.objects.create(app=self.app, cert_id='e7611f4093304719aa10902ecbaf1aa4') refresh_iarc_ratings.Command().handle() eq_(refresh_iarc_ratings_delay_mock.call_count, 1) eq_(refresh_iarc_ratings_delay_mock.call_args[0], ([self.app.pk], ))
def test_refresh_create(self): IARCInfo.objects.create( addon=self.webapp, submission_id=52, security_code='FZ32CU8') refresh_iarc_ratings.Command().handle() ok_(self.webapp.rating_descriptors) ok_(self.webapp.rating_interactives) ok_(self.webapp.content_ratings.count())
def test_refresh_update(self): IARCInfo.objects.create( addon=self.webapp, submission_id=52, security_code='FZ32CU8') rd = RatingDescriptors.objects.create( addon=self.webapp, has_usk_violence=True) refresh_iarc_ratings.Command().handle() ok_(rd.reload().has_esrb_strong_lang) ok_(not rd.has_usk_violence)
def test_single_app(self): IARCInfo.objects.create( addon=self.webapp, submission_id=52, security_code='FZ32CU8') refresh_iarc_ratings.Command().handle(apps=unicode(self.webapp.id)) ok_(self.webapp.content_ratings.count())
def test_no_cert_no_refresh(self): refresh_iarc_ratings.Command().handle() ok_(not self.webapp.content_ratings.count())