2019-01-23 06:49:30 +08:00
|
|
|
import os
|
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
|
2019-01-23 23:20:25 +08:00
|
|
|
from . import PostgreSQLSimpleTestCase
|
2019-01-23 06:49:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
class PostgresIntegrationTests(PostgreSQLSimpleTestCase):
|
|
|
|
def test_check(self):
|
2019-01-23 23:20:25 +08:00
|
|
|
old_cwd = os.getcwd()
|
|
|
|
self.addCleanup(lambda: os.chdir(old_cwd))
|
2019-01-23 06:49:30 +08:00
|
|
|
os.chdir(os.path.dirname(__file__))
|
|
|
|
result = subprocess.run(
|
|
|
|
[sys.executable, '-m', 'django', 'check', '--settings', 'integration_settings'],
|
|
|
|
stdout=subprocess.DEVNULL,
|
|
|
|
stderr=subprocess.PIPE,
|
|
|
|
)
|
|
|
|
stderr = '\n'.join([e.decode() for e in result.stderr.splitlines()])
|
|
|
|
self.assertEqual(result.returncode, 0, msg=stderr)
|