def test_localize_all_image_urls(self):
     new_items = mod.localize_all_image_urls(self.assessment_items)
     old_item_data = self.assessment_items.values()[0]["item_data"]
     new_item_data = new_items.values()[0]["item_data"]
     self.assertEqual(
         old_item_data.replace(
             "https://ka-perseus-graphie.s3.amazonaws.com/",
             "/content/khan/"), new_item_data)
     self.assertNotIn("https://ka-perseus", new_item_data)
 def test_localize_all_image_urls(self):
     new_items = mod.localize_all_image_urls(self.assessment_items)
     old_item_data = self.assessment_items.values()[0]["item_data"]
     new_item_data = new_items.values()[0]["item_data"]
     self.assertEqual(old_item_data.replace("https://ka-perseus-graphie.s3.amazonaws.com/", "/content/khan/"), new_item_data)
     self.assertNotIn("https://ka-perseus", new_item_data)
    def test_localize_all_image_urls_replaces_with_local_urls(self):
        new_assessment_items = mod.localize_all_image_urls(self.assessment_sample)

        all_images = list(mod.find_all_image_urls(new_assessment_items))
        self.assertNotIn(self.imgurl, all_images)
 def test_localize_all_image_urls(self):
     new_items = mod.localize_all_image_urls(self.assessment_items)
     old_item_data = self.assessment_items.values()[0]["item_data"]
     new_item_data = new_items.values()[0]["item_data"]
     self.assertNotIn("https://ka-perseus", new_item_data)
    def test_localize_all_image_urls_replaces_with_local_urls(self):
        new_assessment_items = mod.localize_all_image_urls(
            self.assessment_sample)

        all_images = list(mod.find_all_image_urls(new_assessment_items))
        self.assertNotIn(self.imgurl, all_images)
 def test_localize_all_image_urls(self):
     new_items = mod.localize_all_image_urls(self.assessment_items)
     old_item_data = self.assessment_items.values()[0]["item_data"]
     new_item_data = new_items.values()[0]["item_data"]
     self.assertNotIn("https://ka-perseus", new_item_data)