示例#1
0
    def test_full_url_thumb(self):
        """
        helper meant to combine urls with our site url if not netloc is present
        or if a full url is passed in simply return that
        """
        local = full_url_thumb("/static/monkey.png")
        self.assertEqual(local, "https://www.lawpal.com/static/monkey.png")

        http = full_url_thumb("http://exmaple.com/static/monkey.png")
        self.assertEqual(http, "http://exmaple.com/static/monkey.png")

        https = full_url_thumb("https://exmaple.com/static/monkey.png")
        self.assertEqual(https, "https://exmaple.com/static/monkey.png")
示例#2
0
 def test_full_url_thumb_another_site(self):
     local = full_url_thumb("/static/monkey.png")
     self.assertEqual(local, "http://local.weareml.com:8000/static/monkey.png")