def test_foreign_url(self): path = 'http://path.com/img.jpg' self.assertEqual(get_placeholder_url(path), path)
def test_mapped_secondary_url(self): path = "http://example.com/media/path/to/img.jpg" self.assertEqual( get_placeholder_url(path), 'http://example.com/media/lt/lt_cache/{{ action }}/{{ dimensions }}/path/to/img.jpg' )
def test_local_url(self): path = 'path/img.jpg' expected = 'http://media.example.com/media/lt/lt_cache/{{ action }}/{{ dimensions }}/path/img.jpg' self.assertEqual(get_placeholder_url(path), expected)
def test_foreign_url(self): path = "http://path.com/img.jpg" self.assertEqual(get_placeholder_url(path), path)
def test_local_url(self): path = "path/img.jpg" expected = LT_IMG_URL_FORMAT % ("{{ action }}", "{{ dimensions }}", path) self.assertEqual(get_placeholder_url(path), expected)
def test_mapped_secondary_url(self): path = "http://example.com/media/path/to/img.jpg" self.assertEqual(get_placeholder_url(path), 'http://example.com/media/lt/lt_cache/{{ action }}/{{ dimensions }}/path/to/img.jpg')