def test_external_rspec(self): self.test_create_aggregates() adv_rspec = rspec_mod.get_resources(None, None) d1 = rspec_mod.parse_external_rspec(adv_rspec) # replace all the urn prefixes with external ones test_prefix = publicid_to_urn( "IDN %s//%s" % ("test//test", settings.OPENFLOW_GCF_BASE_SUFFIX)) adv_rspec2 = adv_rspec.replace(rspec_mod.OPENFLOW_GAPI_RSC_URN_PREFIX, test_prefix) d2 = rspec_mod.parse_external_rspec(adv_rspec2) self.assertEqual(d1, d2)
def test_external_rspec(self): self.test_create_aggregates() adv_rspec = rspec_mod.get_resources(None, None) d1 = rspec_mod.parse_external_rspec(adv_rspec) # replace all the urn prefixes with external ones test_prefix = publicid_to_urn( "IDN %s//%s" % ("test//test", settings.OPENFLOW_GCF_BASE_SUFFIX) ) adv_rspec2 = adv_rspec.replace( rspec_mod.OPENFLOW_GAPI_RSC_URN_PREFIX, test_prefix) d2 = rspec_mod.parse_external_rspec(adv_rspec2) self.assertEqual(d1, d2)
def download_adv_rspec(request): adv_rspec = rspec.get_resources(None, True) response = HttpResponse(adv_rspec, mimetype='application/force-download') response['Content-Disposition'] = 'attachment; filename=adv_rspec.xml' return response