forked from palewire/django-postgres-copy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·114 lines (105 loc) · 4 KB
/
setup.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import os
from setuptools import setup
from distutils.core import Command
def read(fname):
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
return f.read()
class TestCommand(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import django
from django.core.management import call_command
from django.conf import settings
settings.configure(
DATABASES={
'default': {
'NAME': 'test',
'USER': 'postgres',
'ENGINE': 'django.db.backends.postgresql_psycopg2'
},
'alternative': {
'NAME': 'test_alternative',
'USER': 'postgres',
'ENGINE': 'django.db.backends.postgresql_psycopg2'
},
'sqlite': {
'NAME': 'sqlite',
'ENGINE': 'django.db.backends.sqlite3'
},
'secondary': {
'NAME': 'test_secondary',
'USER': 'postgres',
'ENGINE': 'django.db.backends.postgresql_psycopg2'
}
},
INSTALLED_APPS=("tests",),
DATABASE_ROUTERS=['tests.router.CustomRouter'],
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': os.path.join(os.path.dirname(__file__), 'tests.log'),
},
<