summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/inspectdb/tests.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/inspectdb/tests.py b/tests/inspectdb/tests.py
index 6fd1778b55..37ba8db89c 100644
--- a/tests/inspectdb/tests.py
+++ b/tests/inspectdb/tests.py
@@ -28,6 +28,17 @@ class InspectDBTestCase(TestCase):
# inspected
self.assertNotIn("class DjangoContentType(models.Model):", out.getvalue(), msg=error_message)
+ def test_table_option(self):
+ """
+ inspectdb can inspect a subset of tables by passing the table names as
+ arguments.
+ """
+ out = StringIO()
+ call_command('inspectdb', 'inspectdb_people', stdout=out)
+ output = out.getvalue()
+ self.assertIn('class InspectdbPeople(models.Model):', output)
+ self.assertNotIn("InspectdbPeopledata", output)
+
def make_field_type_asserter(self):
"""Call inspectdb and return a function to validate a field type in its output"""
out = StringIO()