示例#1
0
 def test_foreign_url(self):
     path = 'http://path.com/img.jpg'
     self.assertEqual(get_placeholder_url(path), path)
示例#2
0
 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'
     )
示例#3
0
 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)
示例#4
0
 def test_foreign_url(self):
     path = "http://path.com/img.jpg"
     self.assertEqual(get_placeholder_url(path), path)
示例#5
0
 def test_local_url(self):
     path = "path/img.jpg"
     expected = LT_IMG_URL_FORMAT % ("{{ action }}", "{{ dimensions }}", path)
     self.assertEqual(get_placeholder_url(path), expected)
示例#6
0
 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')
示例#7
0
 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)