This repository has been archived by the owner on May 8, 2020. It is now read-only.
forked from paulocheque/django-dynamic-fixture
-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings_ddf.py
62 lines (45 loc) · 1.69 KB
/
settings_ddf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from distutils.version import StrictVersion
import django
DJANGO_VERSION = django.get_version()[0:3]
DEBUG = True
IMPORT_DDF_MODELS = True
SECRET_KEY = 'ddf-secret-key'
ALLOWED_HOSTS = ['*'] # Since Django 1.11, it is verified when running tests
INSTALLED_APPS = ()
INSTALLED_APPS += (
'queries',
'django_nose',
'django_dynamic_fixture',
'django.contrib.contenttypes',
)
try:
import polymorphic
INSTALLED_APPS += ('polymorphic',)
except ImportError:
pass
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
NOSE_PLUGINS = ['queries.Queries', 'ddf_setup.DDFSetup']
# Tell nose to measure coverage on the 'foo' and 'bar' apps
NOSE_ARGS = [
'--with-coverage',
'--cover-html',
'--cover-package=django_dynamic_fixture',
'--cover-tests',
'--cover-erase',
'--verbosity=1'
]
# EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
# EMAIL_FILE_PATH = '/tmp/invest-messages' # change this to a proper location
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# python manage.py test --with-coverage --cover-inclusive --cover-html --cover-package=django_dynamic_fixture.* --with-queries --with-ddf-setup
# To avoid warnings
MIDDLEWARE_CLASSES = ()
# Example of DDF plugins for Custom fields
import json
DDF_FIELD_FIXTURES = {
'django_dynamic_fixture.models_test.CustomDjangoField': {'ddf_fixture': lambda: 123456789},
'django_dynamic_fixture.models_test.CustomDjangoField2': lambda: 987654321,
# https://github.com/bradjasper/django-jsonfield
'jsonfield.fields.JSONCharField': {'ddf_fixture': lambda: json.dumps({'some random value': 'c'})},
'jsonfield.fields.JSONField': {'ddf_fixture': lambda: json.dumps([1, 2, 3])},
}