django 1.4liveservertestcase1.3的后台
django-liveserver的Python项目详细描述
django liveserver
======
django 1.4a liveservertestcase的简单后台/提取。使用Selenium、Splinter或其他浏览器客户端进行高级功能测试。django核心开发人员获得了好评,提取的代码来自https://gist.github.com/1685139。
快速启动
----
首先使用pip或setup安装。py:
`pip install django liveserver`
install selenium或其他浏览器测试框架:
`pip install selenium`
案例。下面是一个示例:
`` python
来自django廑liveserver.testcases导入liveservertestcase
来自selenium.webdriver.firefox.webdriver导入webdriver
类myseleniumtests(liveservertestcase):
fixtures=['test-data.json']
@classmethod
def setupclass(cls):
cls.selenium=webdriver()
super(myseleniumtests,cls).setupclass()
@classmethod
def teardownclass(cls):
super(myseleniumtests,cls).teardownclass()
cls.selenium.quit()
def test\u hello(self):
self.selenium.get(self.live\u server\u url)
self.assertin(“你好世界”,self.selenium.title)
````
notes
----
自从这个代码提取之后,1.4代码已经更改,这个版本可能没有一些有用的改进。
======
django 1.4a liveservertestcase的简单后台/提取。使用Selenium、Splinter或其他浏览器客户端进行高级功能测试。django核心开发人员获得了好评,提取的代码来自https://gist.github.com/1685139。
快速启动
----
首先使用pip或setup安装。py:
`pip install django liveserver`
install selenium或其他浏览器测试框架:
`pip install selenium`
案例。下面是一个示例:
`` python
来自django廑liveserver.testcases导入liveservertestcase
来自selenium.webdriver.firefox.webdriver导入webdriver
类myseleniumtests(liveservertestcase):
fixtures=['test-data.json']
@classmethod
def setupclass(cls):
cls.selenium=webdriver()
super(myseleniumtests,cls).setupclass()
@classmethod
def teardownclass(cls):
super(myseleniumtests,cls).teardownclass()
cls.selenium.quit()
def test\u hello(self):
self.selenium.get(self.live\u server\u url)
self.assertin(“你好世界”,self.selenium.title)
````
notes
----
自从这个代码提取之后,1.4代码已经更改,这个版本可能没有一些有用的改进。