summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHonza Král <Honza.Kral@gmail.com>2013-02-24 04:02:26 -0800
committerHonza Král <Honza.Kral@gmail.com>2013-02-24 04:02:26 -0800
commite4e12875905ae7360e131e9ef93ce91c638b65fd (patch)
tree4365d7896350460ec6967d86d42e26445857497e /tests
parentcbb9f629b88d97dd9a3f8d425fd56c8b80d7cddf (diff)
parent5099f31a31c80e82bdc185b23c9ac5f1f472fefb (diff)
Merge pull request #817 from rybaktomasz/ticket_5568
Fixes #5568 -- DROP INDEX subcommand
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/bash_completion/tests.py2
-rw-r--r--tests/regressiontests/commands_sql/tests.py9
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/regressiontests/bash_completion/tests.py b/tests/regressiontests/bash_completion/tests.py
index ed8cedf1ab..4fdb793feb 100644
--- a/tests/regressiontests/bash_completion/tests.py
+++ b/tests/regressiontests/bash_completion/tests.py
@@ -66,7 +66,7 @@ class BashCompletionTests(unittest.TestCase):
"Subcommands can be autocompleted"
self._user_input('django-admin.py sql')
output = self._run_autocomplete()
- self.assertEqual(output, ['sql sqlall sqlclear sqlcustom sqlflush sqlindexes sqlinitialdata sqlsequencereset'])
+ self.assertEqual(output, ['sql sqlall sqlclear sqlcustom sqldropindexes sqlflush sqlindexes sqlinitialdata sqlsequencereset'])
def test_help(self):
"No errors, just an empty list if there are no autocomplete options"
diff --git a/tests/regressiontests/commands_sql/tests.py b/tests/regressiontests/commands_sql/tests.py
index 723e5cc3f7..949032ae6f 100644
--- a/tests/regressiontests/commands_sql/tests.py
+++ b/tests/regressiontests/commands_sql/tests.py
@@ -2,7 +2,7 @@ from __future__ import unicode_literals
from django.core.management.color import no_style
from django.core.management.sql import (sql_create, sql_delete, sql_indexes,
- sql_all)
+ sql_destroy_indexes, sql_all)
from django.db import connections, DEFAULT_DB_ALIAS, models
from django.test import TestCase
from django.utils import six
@@ -36,6 +36,13 @@ class SQLCommandsTestCase(TestCase):
self.assertIn(len(output), [1, 2])
self.assertTrue(output[0].startswith("CREATE INDEX"))
+ def test_sql_destroy_indexes(self):
+ app = models.get_app('commands_sql')
+ output = sql_destroy_indexes(app, no_style(), connections[DEFAULT_DB_ALIAS])
+ # PostgreSQL creates two indexes
+ self.assertIn(len(output), [1, 2])
+ self.assertTrue(output[0].startswith("DROP INDEX"))
+
def test_sql_all(self):
app = models.get_app('commands_sql')
output = sql_all(app, no_style(), connections[DEFAULT_DB_ALIAS])