當前位置: 首頁>>代碼示例>>Python>>正文


Python Meta.get_full_url方法代碼示例

本文整理匯總了Python中meta.views.Meta.get_full_url方法的典型用法代碼示例。如果您正苦於以下問題:Python Meta.get_full_url方法的具體用法?Python Meta.get_full_url怎麽用?Python Meta.get_full_url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在meta.views.Meta的用法示例。


在下文中一共展示了Meta.get_full_url方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_get_full_url_without_schema

# 需要導入模塊: from meta.views import Meta [as 別名]
# 或者: from meta.views.Meta import get_full_url [as 別名]
 def test_get_full_url_without_schema(self):
     meta.settings.SITE_PROTOCOL = 'https'
     m = Meta()
     self.assertEqual(
         m.get_full_url('//foo.com/foo/bar'),
         'https://foo.com/foo/bar'
     )
開發者ID:intip,項目名稱:django-meta,代碼行數:9,代碼來源:test_meta.py

示例2: test_get_full_url_with_absolute_path

# 需要導入模塊: from meta.views import Meta [as 別名]
# 或者: from meta.views.Meta import get_full_url [as 別名]
 def test_get_full_url_with_absolute_path(self):
     meta.settings.SITE_PROTOCOL = 'https'
     meta.settings.SITE_DOMAIN = 'foo.com'
     m = Meta()
     self.assertEqual(
         m.get_full_url('/foo/bar'),
         'https://foo.com/foo/bar'
     )
開發者ID:Work4Labs,項目名稱:django-meta,代碼行數:10,代碼來源:test_meta.py

示例3: test_get_full_url_with_domain_and_protocol

# 需要導入模塊: from meta.views import Meta [as 別名]
# 或者: from meta.views.Meta import get_full_url [as 別名]
 def test_get_full_url_with_domain_and_protocol(self):
     meta.settings.SITE_PROTOCOL = 'https'
     meta.settings.SITE_DOMAIN = 'foo.com'
     m = Meta()
     self.assertEqual(
         m.get_full_url('foo/bar'),
         'https://foo.com/foo/bar'
     )
開發者ID:Work4Labs,項目名稱:django-meta,代碼行數:10,代碼來源:test_meta.py

示例4: test_get_full_url_without_site_id_with_request_will_not_raise

# 需要導入模塊: from meta.views import Meta [as 別名]
# 或者: from meta.views.Meta import get_full_url [as 別名]
 def test_get_full_url_without_site_id_with_request_will_not_raise(self):
     settings.USE_SITES = True
     settings.SITE_PROTOCOL = 'http'
     factory = RequestFactory()
     request = factory.get('/')
     Site.objects.create(domain=request.get_host())
     m = Meta(request=request)
     self.assertEqual(
         m.get_full_url('foo/bar'),
         'http://testserver/foo/bar'
     )
開發者ID:nephila,項目名稱:django-meta,代碼行數:13,代碼來源:test_meta.py

示例5: test_get_full_url_without_domain_will_raise

# 需要導入模塊: from meta.views import Meta [as 別名]
# 或者: from meta.views.Meta import get_full_url [as 別名]
 def test_get_full_url_without_domain_will_raise(self):
     meta.settings.SITE_PROTOCOL = 'http'
     m = Meta()
     with self.assertRaises(ImproperlyConfigured):
         m.get_full_url('foo/bar')
開發者ID:Work4Labs,項目名稱:django-meta,代碼行數:7,代碼來源:test_meta.py

示例6: test_get_full_url_without_protocol_will_raise

# 需要導入模塊: from meta.views import Meta [as 別名]
# 或者: from meta.views.Meta import get_full_url [as 別名]
 def test_get_full_url_without_protocol_will_raise(self):
     m = Meta()
     with self.assertRaises(ImproperlyConfigured):
         m.get_full_url('foo/bar')
開發者ID:Work4Labs,項目名稱:django-meta,代碼行數:6,代碼來源:test_meta.py

示例7: test_get_full_url_with_full_url

# 需要導入模塊: from meta.views import Meta [as 別名]
# 或者: from meta.views.Meta import get_full_url [as 別名]
 def test_get_full_url_with_full_url(self):
     m = Meta()
     self.assertEqual(
         m.get_full_url('http://example.com/foo'),
         'http://example.com/foo'
     )
開發者ID:Work4Labs,項目名稱:django-meta,代碼行數:8,代碼來源:test_meta.py

示例8: test_get_full_url_with_None

# 需要導入模塊: from meta.views import Meta [as 別名]
# 或者: from meta.views.Meta import get_full_url [as 別名]
 def test_get_full_url_with_None(self):
     m = Meta()
     self.assertEqual(m.get_full_url(None), None)
開發者ID:Work4Labs,項目名稱:django-meta,代碼行數:5,代碼來源:test_meta.py

示例9: test_get_full_url_with_absolute_path

# 需要導入模塊: from meta.views import Meta [as 別名]
# 或者: from meta.views.Meta import get_full_url [as 別名]
 def test_get_full_url_with_absolute_path(self):
     meta.settings.SITE_PROTOCOL = "https"
     meta.settings.SITE_DOMAIN = "foo.com"
     m = Meta()
     self.assertEqual(m.get_full_url("/foo/bar"), "https://foo.com/foo/bar")
開發者ID:sergei-maertens,項目名稱:django-meta,代碼行數:7,代碼來源:test_meta.py

示例10: test_get_full_url_with_domain_and_protocol

# 需要導入模塊: from meta.views import Meta [as 別名]
# 或者: from meta.views.Meta import get_full_url [as 別名]
 def test_get_full_url_with_domain_and_protocol(self):
     meta.settings.SITE_PROTOCOL = "https"
     meta.settings.SITE_DOMAIN = "foo.com"
     m = Meta()
     self.assertEqual(m.get_full_url("foo/bar"), "https://foo.com/foo/bar")
開發者ID:sergei-maertens,項目名稱:django-meta,代碼行數:7,代碼來源:test_meta.py

示例11: test_get_full_url_without_site_id_will_raise

# 需要導入模塊: from meta.views import Meta [as 別名]
# 或者: from meta.views.Meta import get_full_url [as 別名]
 def test_get_full_url_without_site_id_will_raise(self):
     settings.USE_SITES = True
     settings.SITE_PROTOCOL = 'http'
     m = Meta()
     with self.assertRaises(ImproperlyConfigured):
         m.get_full_url('foo/bar')
開發者ID:nephila,項目名稱:django-meta,代碼行數:8,代碼來源:test_meta.py


注:本文中的meta.views.Meta.get_full_url方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。