当前位置: 首页>>代码示例>>Python>>正文


Python LiveServerTestCase.setUpClass方法代码示例

本文整理汇总了Python中django.test.LiveServerTestCase.setUpClass方法的典型用法代码示例。如果您正苦于以下问题:Python LiveServerTestCase.setUpClass方法的具体用法?Python LiveServerTestCase.setUpClass怎么用?Python LiveServerTestCase.setUpClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在django.test.LiveServerTestCase的用法示例。


在下文中一共展示了LiveServerTestCase.setUpClass方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUpClass

# 需要导入模块: from django.test import LiveServerTestCase [as 别名]
# 或者: from django.test.LiveServerTestCase import setUpClass [as 别名]
 def setUpClass(cls):
     for arg in sys.argv:
         if 'liveserver' in arg:
             cls.server_url = 'http://' + arg.split('=')[1]
             return
     LiveServerTestCase.setUpClass()
     cls.server_url = cls.live_server_url
开发者ID:dapullar,项目名称:tdd-workshop,代码行数:9,代码来源:tests.py

示例2: setUpClass

# 需要导入模块: from django.test import LiveServerTestCase [as 别名]
# 或者: from django.test.LiveServerTestCase import setUpClass [as 别名]
 def setUpClass(cls):
     for arg in sys.argv:
         if 'liveserver' in arg:
             cls.server_url = 'http://' + arg.split('=')[1]
             fixtures = []   #no fixtures for testing liveserver staging
             return
     LiveServerTestCase.setUpClass()
     cls.server_url = cls.live_server_url
开发者ID:chrismcginlay,项目名称:eduduck,代码行数:10,代码来源:base.py

示例3: setUpClass

# 需要导入模块: from django.test import LiveServerTestCase [as 别名]
# 或者: from django.test.LiveServerTestCase import setUpClass [as 别名]
 def setUpClass(cls):
     for arg in sys.argv:
         if 'liveserver' in arg:
             cls.server_url = "http://" + arg.split("=")[1]
             return
     LiveServerTestCase.setUpClass()
     #cls.server_url = cls.live_server_url
     cls.server_url = "http://127.0.0.1:8081/"
开发者ID:Nazerbayev,项目名称:django-tdd-test,代码行数:10,代码来源:tests.py

示例4: setUpClass

# 需要导入模块: from django.test import LiveServerTestCase [as 别名]
# 或者: from django.test.LiveServerTestCase import setUpClass [as 别名]
 def setUpClass(cls):
     for arg in sys.argv:
         if "liveserver" in arg:
             cls.server_host = arg.split("=")[1]
             cls.server_url = "http://" + cls.server_host
             cls.against_staging = True
             return
     LiveServerTestCase.setUpClass()
     cls.against_staging = False
     cls.server_url = cls.live_server_url
开发者ID:trenton3983,项目名称:Test_Driven_Development,代码行数:12,代码来源:base.py

示例5: setUpClass

# 需要导入模块: from django.test import LiveServerTestCase [as 别名]
# 或者: from django.test.LiveServerTestCase import setUpClass [as 别名]
	def setUpClass(cls):
		"""
		this methos allow run test using:
		manage.py test functional_tests --liveserver=my-staging-server.com
		"""
		for arg in sys.argv:
			if 'liveserver' in arg:
				cls.server_url = 'http://' + arg.split('=')[1]
				return
		LiveServerTestCase.setUpClass()
		cls.server_url = cls.live_server_url
开发者ID:huogerac,项目名称:modulo4,代码行数:13,代码来源:base.py

示例6: setUpClass

# 需要导入模块: from django.test import LiveServerTestCase [as 别名]
# 或者: from django.test.LiveServerTestCase import setUpClass [as 别名]
 def setUpClass(cls):
     cls.display = None
     try:
         display = Display(visible=0, size=(1024, 768))
         display.start()
     except:
         pass
     for arg in sys.argv:
         if 'liveserver' in arg:
             cls.server_url = 'http://' + arg.split('=')[1]
             return
     cls.browser = webdriver.Firefox()
     cls.browser.implicitly_wait(5)
     LiveServerTestCase.setUpClass()
     cls.server_url = cls.live_server_url
开发者ID:simodalla,项目名称:mezzanine_mailchimper,代码行数:17,代码来源:base.py

示例7: start_liveserver_if_needed

# 需要导入模块: from django.test import LiveServerTestCase [as 别名]
# 或者: from django.test.LiveServerTestCase import setUpClass [as 别名]
 def start_liveserver_if_needed(cls):
     cls.liveserver_url = None
     for api_cls in cls.get_test_api_classes():
         if not getattr(api_cls, 'needs_live_server', False):
             continue
         if cls.liveserver_url is None:
             LiveServerTestCase.setUpClass()
             cls.selenium = WebDriver()
             # inlined from LiveServerTestCase
             cls.liveserver_url = 'http://%s:%s' % (
                 LiveServerTestCase.server_thread.host, LiveServerTestCase.server_thread.port)
         api_cls.server_thread = LiveServerTestCase.server_thread
         api_cls.selenium = cls.selenium
         api_cls.liveserver_url = cls.liveserver_url
     cls.has_liveserver = cls.liveserver_url is not None
开发者ID:zsoldosp,项目名称:polytesting-taskboard,代码行数:17,代码来源:__init__.py


注:本文中的django.test.LiveServerTestCase.setUpClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。