当前位置: 首页>>代码示例>>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;未经允许,请勿转载。