def test_caches_published_evaluation(self): evaluation = mommy.make(Evaluation, state='published') self.assertIsNone(caches['results'].get(get_collect_results_cache_key(evaluation))) collect_results(evaluation) self.assertIsNotNone(caches['results'].get(get_collect_results_cache_key(evaluation)))
def test_caches_published_course(self): course = mommy.make(Course, state='published') self.assertIsNone(caches['results'].get(get_collect_results_cache_key(course))) collect_results(course) self.assertIsNotNone(caches['results'].get(get_collect_results_cache_key(course)))
def test_caches_published_evaluation(self): evaluation = baker.make(Evaluation, state='published') self.assertIsNone(caches['results'].get( get_collect_results_cache_key(evaluation))) collect_results(evaluation) self.assertIsNotNone(caches['results'].get( get_collect_results_cache_key(evaluation)))
def test_cache_unpublished_evaluation(self): evaluation = mommy.make(Evaluation, state='published', _voter_count=0, _participant_count=0) collect_results(evaluation) evaluation.unpublish() evaluation.save() self.assertIsNone(caches['results'].get(get_collect_results_cache_key(evaluation)))
def test_cache_unpublished_course(self): course = mommy.make(Course, state='published', _voter_count=0, _participant_count=0) collect_results(course) course.unpublish() self.assertIsNone(caches['results'].get( get_collect_results_cache_key(course)))
def test_cache_unpublished_evaluation(self): evaluation = mommy.make(Evaluation, state='published', _voter_count=0, _participant_count=0) collect_results(evaluation) evaluation.unpublish() self.assertIsNone(caches['results'].get( get_collect_results_cache_key(evaluation)))
def delete_cache_on_unpublish(instance, source, **_kwargs): if source == 'published': from evap.results.tools import get_collect_results_cache_key from evap.results.views import delete_template_cache caches['results'].delete(get_collect_results_cache_key(instance)) delete_template_cache(instance)
def test_cache_unpublished_course(self): course = mommy.make(Course, state='published', _voter_count=0, _participant_count=0) collect_results(course) course.unpublish() self.assertIsNone(caches['results'].get(get_collect_results_cache_key(course)))