Package: django-easytests
================django-easytests================Utils for test setup based on test utils from django-cmsInstallation------------For the current stable version:::pip install django-easytestsFor the development version:::pip install -e git+git://github.com/fivethreeo/django-easytests.git@develop#egg=django-easytestsExample usage in develop.py:-----------------------------::#!/usr/bin/env pythonfrom djeasytests.testsetup import TestSetupsettings = dict(ROOT_URLCONF='appname_test_project.urls',INSTALLED_APPS = ['appname_test_project','appname','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.admin','django.contrib.sites','django.contrib.staticfiles'])testsetup = TestSetup(appname='appname',test_settings=settings)if __name__ == '__main__':testsetup.run(__file__)Project structure-----------------How to lay out files for using django-easytests::django-appname...appname/__init__.pyviews.pyurls.pymodels.pytests.pytesting/appname_test_project/__init__.pytemplates/appname/README.rstMANIFEST.inLICENSE.travis.ymldevelop.py...Running tests and commands--------------------------::develop.py testdevelop.py --failfast testdevelop.py --parallel testdevelop.py --migrate testdevelop.py test test_labels heredevelop.py timed testdevelop.py isolated testdevelop.py manage helpdevelop.py manage syncdbdevelop.py serverUsing a custom database-----------------------Simply set a environment varable::export DATABASE_URL="postgres://myuser:mypass@localhost/mydb"Then test, server and manage will use this database.Using existing settings:-----------------------Useful for testing projectsappname/base_settings.py========================::ROOT_URLCONF = 'appname.urls',INSTALLED_APPS = ['appname'.'django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.admin','django.contrib.sites','django.contrib.staticfiles']appname/settings.py===================::from appname.base_settings import *from local_settings import *appname/local_settings.py=========================::SOME_LOCAL_SETTING = Falsedevelop.py==========::settings = dict(DEBUG = True)from appname import base_settingstestsetup = TestSetup(appname='appname',test_settings=settings,fallback_settings=base_settings)if __name__ == '__main__':testsetup.run(__file__)default_settings================By default fallback_settings gets merged with default_settings ( by default django.conf.global_settings) like in djangos settings.configure.This can be changed by passing default_settings with a module/object other than global_settings to TestSetup.::from appname import other_global_settingstestsetup = TestSetup(appname='appname',test_settings=settings,fallback_settings=base_settings,default_settings=other_global_settings)Additional apps (test_modules) for testing==========================================Say you want this filestructure when the amount of test increase exponentially::django-appname...appname/__init__.pyviews.pyurls.pymodels.pytesting/appname_test_project/__init__.pytemplates/appname/appname_modeltests/__init__.pytests.pymodels.pyappname_admintests/__init__.pytests.pymodels.pyappname_somothertests/__init__.pytests.pymodels.pyREADME.rstMANIFEST.inLICENSE.travis.ymldevelop.py...In develop.py::from djeasytests.testsetup import TestSetupsettings = dict(ROOT_URLCONF='appname_test_project.urls',INSTALLED_APPS = ['appname_modeltests','appname_admintests','appname_somothertests','appname_test_project','appname','django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.admin','django.contrib.sites','django.contrib.staticfiles'])testsetup = TestSetup(appname='appname',test_settings=settings,test_modules=['appname_modeltests','appname_admintests','appname_somothertests'])if __name__ == '__main__':testsetup.run(__file__)