A backport of the Django 1.4 LiveServerTestCase for 1.3
Project description
Django LiveServer
==================
A simple backport/extraction of the Django 1.4a LiveServerTestCase. Use selenium, splinter, or other browser clients for advanced functional testing. Credit goes to the Django core developers and extracted code comes from https://gist.github.com/1685139.
Quick Start
-----------
First install using pip or setup.py:
`pip install django-liveserver`
Install selenium or another browser testing framework:
`pip install selenium`
Create your own test case. Here is an example:
```python
from django_liveserver.testcases import LiveServerTestCase
from selenium.webdriver.firefox.webdriver import WebDriver
class 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_hello(self):
self.selenium.get(self.live_server_url)
self.assertIn("Hello World", self.selenium.title)
```
Notes
-----
Since this code extraction, the 1.4 code has changed and this version might not include some useful improvements.
==================
A simple backport/extraction of the Django 1.4a LiveServerTestCase. Use selenium, splinter, or other browser clients for advanced functional testing. Credit goes to the Django core developers and extracted code comes from https://gist.github.com/1685139.
Quick Start
-----------
First install using pip or setup.py:
`pip install django-liveserver`
Install selenium or another browser testing framework:
`pip install selenium`
Create your own test case. Here is an example:
```python
from django_liveserver.testcases import LiveServerTestCase
from selenium.webdriver.firefox.webdriver import WebDriver
class 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_hello(self):
self.selenium.get(self.live_server_url)
self.assertIn("Hello World", self.selenium.title)
```
Notes
-----
Since this code extraction, the 1.4 code has changed and this version might not include some useful improvements.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-liveserver-0.1a.tar.gz
(5.0 kB
view hashes)
Built Distribution
django_liveserver-0.1a-py2.7.egg
(10.5 kB
view hashes)
Close
Hashes for django_liveserver-0.1a-py2.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 799d0046d222b06e0492a1b0dd93360104a16b12f4a25521e37ad07a33ce6db2 |
|
MD5 | ff06f3686c3c0d46be3b717314caa8dc |
|
BLAKE2b-256 | 0b12632b354fb8f53057499ef6e720d2d714fd9db69ca884b732fec7f07bd677 |