No project description provided
Project description
Django Extant Test DB
=====================
This package provides a Django test runner that uses unittest2 test discovery,
and can test against a pre-existing database when configured to do so.
## Quickstart
```bash
pip install django-extant-test-db
```
In _settings.py_, set the following:
```python
TEST_RUNNER = 'extant_test_db.runner.DiscoverRunner'
```
For any databases you want to be unmanaged by the test runner, add the
following:
```python
DATABASES = {
...
'TEST': {
'MANAGED': False,
},
...
}
```
## Configuration
This package provides a Django test runner that uses unittest2 test discovery,
and can test against a pre-existing database when configured to do so. In order
to use an extant database for tests (e.g., if you have a large database full of
read-only data), in your database TEST settings, set a MANAGED flag:
```python
DATABASES = {
'default': {
...
},
'warehouse': {
...
'TEST': {
'MANAGED': False,
},
}
}
```
The database used will be the same as the one used for the webserver, though
you can also provide an alternative test database name:
```python
DATABASES = {
...
'TEST': {
'MANAGED': False,
'NAME': os.environ['TEST_DB_NAME'],
},
...
}
```
=====================
This package provides a Django test runner that uses unittest2 test discovery,
and can test against a pre-existing database when configured to do so.
## Quickstart
```bash
pip install django-extant-test-db
```
In _settings.py_, set the following:
```python
TEST_RUNNER = 'extant_test_db.runner.DiscoverRunner'
```
For any databases you want to be unmanaged by the test runner, add the
following:
```python
DATABASES = {
...
'TEST': {
'MANAGED': False,
},
...
}
```
## Configuration
This package provides a Django test runner that uses unittest2 test discovery,
and can test against a pre-existing database when configured to do so. In order
to use an extant database for tests (e.g., if you have a large database full of
read-only data), in your database TEST settings, set a MANAGED flag:
```python
DATABASES = {
'default': {
...
},
'warehouse': {
...
'TEST': {
'MANAGED': False,
},
}
}
```
The database used will be the same as the one used for the webserver, though
you can also provide an alternative test database name:
```python
DATABASES = {
...
'TEST': {
'MANAGED': False,
'NAME': os.environ['TEST_DB_NAME'],
},
...
}
```
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-extant-test-db-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d2b3d6c2f668d38ee3dd29d3691db662d597bea76f3a92f4afb85e0447243a5 |
|
MD5 | 357b842ca534c9ba808ffaa8635b98bd |
|
BLAKE2b-256 | 7f83122e8290063dad323a06f315dab7e0803a354353089db2be1ec2180807c7 |