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