aboutsummaryrefslogtreecommitdiff
path: root/tests/djapp
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2015-03-26 22:53:15 +0100
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2015-03-26 22:53:15 +0100
commit636ca46951d710a4b9d9fd61ec1da02294806d3d (patch)
tree23b5bd7bfd7938cccd39d72e829562ca6c515137 /tests/djapp
parent72fd943513b0e516f06c53b13ff35ca814b0a4a0 (diff)
downloadfactory-boy-636ca46951d710a4b9d9fd61ec1da02294806d3d.tar
factory-boy-636ca46951d710a4b9d9fd61ec1da02294806d3d.tar.gz
Add support for multidb with Django (Closes #171).
The ``factory.django.DjangoModelFactory`` now takes an extra option: ``` class MyFactory(factory.django.DjangoModelFactory): class Meta: model = models.MyModel database = 'replica' ``` This will create all instances of ``models.Model`` in the ``'replica'`` database.
Diffstat (limited to 'tests/djapp')
-rw-r--r--tests/djapp/settings.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/djapp/settings.py b/tests/djapp/settings.py
index c051faf..18e43dd 100644
--- a/tests/djapp/settings.py
+++ b/tests/djapp/settings.py
@@ -34,6 +34,9 @@ DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
+ 'replica': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ },
}