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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-liveserver-0.1a-2.tar.gz.
File metadata
- Download URL: django-liveserver-0.1a-2.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b71c27659b32dbc9ac46530f7cf127a1b843255da6d58e190acd037dac14035
|
|
| MD5 |
1dbcd15ca1709fb4cd948b1cddfff5e1
|
|
| BLAKE2b-256 |
d0ef5d19b19f39601eed72deefd865c6c257e1762c94d050e2e4db8f1c376f36
|
File details
Details for the file django_liveserver-0.1a_2-py2.7.egg.
File metadata
- Download URL: django_liveserver-0.1a_2-py2.7.egg
- Upload date:
- Size: 10.6 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd711fe79070b1d035e6747cf6bfb62779910b7ae884f2f51721bceb72ec12f3
|
|
| MD5 |
cf227083b22886e8918b656a16405708
|
|
| BLAKE2b-256 |
be5daf03c51eb6f35140fa2708bcf4760f9fad799be3d2aaffe690e73f7d775a
|