Skip to content

disqus/django-test-helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-test-helpers

Test helpers, mostly geared around the database. Tested on Django 1.2.

Install

pip install django-test-helpers

Usage

Create a temporary database:

from testhelpers.dbmanager import TemporaryDatabase

with TemporaryDatabase(fixtures=['myfixture.json'], db_prefix='test'):
    # do some stuff
    pass

Note

If you're using Nashvegas, the TemporaryDatabase will attempt to automatically migrate your database and preserve executed migrations.

Run some commands in transactional isolation:

from testhelpers.dbmanager import Transactionless

with Transactionless(fixtures=['myfixture.json']):
    # do some stuff
    pass

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages