mirror of
https://github.com/jazzband/django-configurations.git
synced 2026-05-28 16:58:21 +00:00
Add a test for configuration argument
This test do not use mock, and only searches the `configuration` option in the help messages.
This commit is contained in:
parent
ae767eaf2d
commit
36a7061a61
1 changed files with 17 additions and 0 deletions
17
tests/test_cli.py
Normal file
17
tests/test_cli.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import os
|
||||
import subprocess
|
||||
|
||||
PROJECT_DIR = os.getcwd()
|
||||
TEST_PROJECT_DIR = os.path.join(PROJECT_DIR, 'test_project')
|
||||
|
||||
|
||||
def test_configuration_argument_in_cli():
|
||||
"""Verify that's configuration option has been added to managements commands"""
|
||||
os.chdir(TEST_PROJECT_DIR)
|
||||
p = subprocess.Popen(['python', 'manage.py', 'test',
|
||||
'--help'], stdout=subprocess.PIPE)
|
||||
assert '--configuration' in p.communicate()[0].decode('UTF-8')
|
||||
p = subprocess.Popen(['python', 'manage.py', 'runserver',
|
||||
'--help'], stdout=subprocess.PIPE)
|
||||
assert '--configuration' in p.communicate()[0].decode('UTF-8')
|
||||
os.chdir(PROJECT_DIR)
|
||||
Loading…
Reference in a new issue