2019-01-22 23:49:30 +01:00
|
|
|
import os
|
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
|
2019-01-23 16:20:25 +01:00
|
|
|
from . import PostgreSQLSimpleTestCase
|
2019-01-22 23:49:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
class PostgresIntegrationTests(PostgreSQLSimpleTestCase):
|
|
|
|
def test_check(self):
|
2019-05-14 19:43:56 +02:00
|
|
|
test_environ = os.environ.copy()
|
|
|
|
if "DJANGO_SETTINGS_MODULE" in test_environ:
|
|
|
|
del test_environ["DJANGO_SETTINGS_MODULE"]
|
|
|
|
test_environ["PYTHONPATH"] = os.path.join(os.path.dirname(__file__), "../../")
|
2019-01-22 23:49:30 +01:00
|
|
|
result = subprocess.run(
|
|
|
|
[
|
|
|
|
sys.executable,
|
|
|
|
"-m",
|
|
|
|
"django",
|
|
|
|
"check",
|
|
|
|
"--settings",
|
|
|
|
"integration_settings",
|
|
|
|
],
|
|
|
|
stdout=subprocess.DEVNULL,
|
|
|
|
stderr=subprocess.PIPE,
|
2019-02-05 17:01:36 +01:00
|
|
|
cwd=os.path.dirname(__file__),
|
2019-11-02 16:00:10 +01:00
|
|
|
env=test_environ,
|
|
|
|
encoding="utf-8",
|
2019-01-22 23:49:30 +01:00
|
|
|
)
|
2019-11-02 16:00:10 +01:00
|
|
|
self.assertEqual(result.returncode, 0, msg=result.stderr)
|