def tearDownClass(cls): clear_cache_manifest() News.objects.all().delete() User.objects.all().delete() if DJANGOCMS: from cms.models import Page Page.objects.all().delete() super(BaseDataTestCase, cls).tearDownClass()
def test_command_view_equivalent(self): request = self.get_request("/", user=self.admin) view = ManifestAppCache.as_view(appcache_update=1) response = view(request) # version / date / comments removed as we're interested in # extracted urls. stripped for the same reason manifest_view = re.sub("# (date|version).+", "", response.content).strip() clear_cache_manifest() call_command("update_manifest") # version / date / comments removed as we're interested in # extracted urls. stripped for the same reason manifest_command = re.sub("# (date|version).+", "", get_cached_manifest()).strip() self.assertEqual(manifest_command, manifest_view)
def test_command_view_equivalent(self): request = self.get_request('/', user=self.admin) view = ManifestAppCache.as_view(appcache_update=1) response = view(request) # version / date / comments removed as we're interested in # extracted urls. stripped for the same reason manifest_view = re.sub("# (date|version).+", "", response.content).strip() clear_cache_manifest() call_command("update_manifest") # version / date / comments removed as we're interested in # extracted urls. stripped for the same reason manifest_command = re.sub("# (date|version).+", "", get_cached_manifest()).strip() self.assertEqual(manifest_command, manifest_view)
def handle(self, *args, **options): clear_cache_manifest()
def setUp(self): clear_cache_manifest()
def get_urls(self): clear_cache_manifest() appcache_registry.extract_urls() appcache_registry.get_manifest(update=True)