summaryrefslogtreecommitdiff
path: root/tests/user_commands
diff options
context:
space:
mode:
authorBaptiste Mispelon <bmispelon@gmail.com>2014-02-18 00:01:03 +0100
committerBaptiste Mispelon <bmispelon@gmail.com>2014-02-18 11:36:06 +0100
commit2a9ee49f3cbdc42a98a0c8bc654165f2f35ef3d6 (patch)
tree5f4815b256807f435d580cb9ea29817959029832 /tests/user_commands
parentb78f9a12c83b19f24b4b450de29159d597059673 (diff)
Removed BaseCommand.stdin introduced in 116d39842dab2569013856e9f3701a7cb6554f09.
This option is not actually very useful in the general case because it doesn't override sys.stdin. It's still marginally useful for testing some features of the createsuperuser command so it was moved there. This commit also makes the detection of a TTY in createsuperuser a bit more robust, after a suggestion of appolo13.
Diffstat (limited to 'tests/user_commands')
-rw-r--r--tests/user_commands/tests.py26
1 files changed, 0 insertions, 26 deletions
diff --git a/tests/user_commands/tests.py b/tests/user_commands/tests.py
index e184d0e6df..52665f1a1c 100644
--- a/tests/user_commands/tests.py
+++ b/tests/user_commands/tests.py
@@ -61,32 +61,6 @@ class CommandTests(SimpleTestCase):
management.call_command('leave_locale_alone_true', stdout=out)
self.assertEqual(out.getvalue(), "pl\n")
- def test_passing_stdin(self):
- """
- You can pass a stdin object to a command's options and it should be
- available on self.stdin.
- """
- class CustomCommand(BaseCommand):
- def handle(self, *args, **kwargs):
- pass
-
- sentinel = object()
- command = CustomCommand()
- command.execute(stdin=sentinel, stdout=StringIO())
- self.assertIs(command.stdin, sentinel)
-
- def test_passing_stdin_default(self):
- """
- If stdin is not passed as an option, the default should be sys.stdin.
- """
- class CustomCommand(BaseCommand):
- def handle(self, *args, **kwargs):
- return 'OK'
-
- command = CustomCommand()
- command.execute(stdout=StringIO())
- self.assertIs(command.stdin, sys.stdin)
-
class UtilsTests(SimpleTestCase):