-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathsettings_ddf.py
47 lines (33 loc) · 1.34 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
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_dynamic_fixture',
'django.contrib.contenttypes',
)
try:
import polymorphic
INSTALLED_APPS += ('polymorphic',)
except ImportError:
pass
# 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])},
}